[Git][ghc/ghc][wip/jeltsch/textual-bytecode-output] Arrange import declarations according to the styleguide
by Wolfgang Jeltsch (@jeltsch) 22 Jul '26
by Wolfgang Jeltsch (@jeltsch) 22 Jul '26
22 Jul '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/textual-bytecode-output at Glasgow Haskell Compiler / GHC
Commits:
db8af5ce by Wolfgang Jeltsch at 2026-07-22T18:04:49+03:00
Arrange import declarations according to the styleguide
- - - - -
1 changed file:
- compiler/GHC/ByteCode/Show.hs
Changes:
=====================================
compiler/GHC/ByteCode/Show.hs
=====================================
@@ -5,6 +5,7 @@
-- of bytecode files. It is the backbone of the @--show-byte-code@ option.
module GHC.ByteCode.Show (showByteCode) where
+-- Prelude
import GHC.Prelude
(
(+), (-), Integral, div, -- Prelude
@@ -23,14 +24,28 @@ import GHC.Prelude
show, -- Text.Show
IO, FilePath -- System.IO
)
-import Control.Arrow ((>>>))
-import Data.List (zipWith4)
-import Data.ByteString (ByteString)
-import Data.ByteString.Short (ShortByteString)
-import Data.IntMap (IntMap)
-import Data.IntMap qualified as IntMap (toList)
-import Data.Array (bounds, indices, elems)
-import Numeric (showHex)
+
+-- Bytecode
+import GHC.ByteCode.Types
+ (
+ FFIInfo (..),
+ BCONPtr (..),
+ BCOPtr (..),
+ UnlinkedBCO (..),
+ ByteCodeHpcInfo (..),
+ CompiledByteCode (..)
+ )
+import GHC.ByteCode.Breakpoints
+ (
+ InternalBreakpointId (..),
+ InternalBreakLoc (..),
+ CgBreakInfo (..),
+ InternalModBreaks (..)
+ )
+import GHC.ByteCode.Binary (OnDiskModuleByteCode (..))
+import GHC.ByteCode.Serialize (readOnDiskModuleByteCode)
+
+-- GHC apart from bytecode
import GHC.Data.Strict qualified as Strict (Maybe, maybe)
import GHC.Data.FastString (unpackFS)
import GHC.Data.FlatBag (FlatBag, elemsFlatBag)
@@ -62,28 +77,20 @@ import GHC.Utils.Outputable
import GHC.Unit.Types (Module)
import GHC.Iface.Type (IfaceType, IfaceTvBndr, IfaceIdBndr)
import GHC.HsToCore.Breakpoints (ModBreaks (..))
-import GHC.ByteCode.Types
- (
- FFIInfo (..),
- BCONPtr (..),
- BCOPtr (..),
- UnlinkedBCO (..),
- ByteCodeHpcInfo (..),
- CompiledByteCode (..)
- )
-import GHC.ByteCode.Breakpoints
- (
- InternalBreakpointId (..),
- InternalBreakLoc (..),
- CgBreakInfo (..),
- InternalModBreaks (..)
- )
-import GHC.ByteCode.Binary (OnDiskModuleByteCode (..))
-import GHC.ByteCode.Serialize (readOnDiskModuleByteCode)
import GHC.Driver.Env.Types (HscEnv)
import GHCi.FFI (FFIType)
import GHCi.Message (ConInfoTable (..))
+-- Basic things
+import Control.Arrow ((>>>))
+import Data.List (zipWith4)
+import Data.ByteString (ByteString)
+import Data.ByteString.Short (ShortByteString)
+import Data.IntMap (IntMap)
+import Data.IntMap qualified as IntMap (toList)
+import Data.Array (bounds, indices, elems)
+import Numeric (showHex)
+
-- | Outputs textual information about the contents of a bytecode file.
showByteCode :: Logger -> HscEnv -> FilePath -> IO ()
showByteCode logger env path = do
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/db8af5cee171485fdf8cabaf54f4572…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/db8af5cee171485fdf8cabaf54f4572…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/jeltsch/textual-bytecode-output] Switch to using `GHC.Prelude`
by Wolfgang Jeltsch (@jeltsch) 22 Jul '26
by Wolfgang Jeltsch (@jeltsch) 22 Jul '26
22 Jul '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/textual-bytecode-output at Glasgow Haskell Compiler / GHC
Commits:
7598d0f5 by Wolfgang Jeltsch at 2026-07-22T17:55:20+03:00
Switch to using `GHC.Prelude`
- - - - -
1 changed file:
- compiler/GHC/ByteCode/Show.hs
Changes:
=====================================
compiler/GHC/ByteCode/Show.hs
=====================================
@@ -5,28 +5,32 @@
-- of bytecode files. It is the backbone of the @--show-byte-code@ option.
module GHC.ByteCode.Show (showByteCode) where
-import Prelude ((+), (-), Integral, div)
+import GHC.Prelude
+ (
+ (+), (-), Integral, div, -- Prelude
+ (==), -- Data.Eq
+ (>=), -- Data.Ord
+ FiniteBits, finiteBitSize, -- Data.Bits
+ ($), id, (.), -- Data.Function
+ fst, uncurry, -- Data.Tuple
+ Bool, otherwise, not, -- Data.Bool
+ Int, -- Data.Int
+ Word, -- Data.Word
+ Maybe, maybe, -- Data.Maybe
+ Either, either, -- Data.Either
+ length, (++), map, take, drop, replicate, -- Data.List
+ String, -- Data.String
+ show, -- Text.Show
+ IO, FilePath -- System.IO
+ )
import Control.Arrow ((>>>))
-import Data.Eq ((==))
-import Data.Ord ((>=))
-import Data.Bits (FiniteBits, finiteBitSize)
-import Data.Function (($), id, (.))
-import Data.Tuple (fst, uncurry)
-import Data.Bool (Bool, otherwise, not)
-import Data.Int (Int)
-import Data.Word (Word)
-import Data.Maybe (Maybe, maybe)
-import Data.Either (Either, either)
-import Data.List (length, (++), map, zipWith4, take, drop, replicate)
-import Data.String (String)
+import Data.List (zipWith4)
import Data.ByteString (ByteString)
import Data.ByteString.Short (ShortByteString)
import Data.IntMap (IntMap)
import Data.IntMap qualified as IntMap (toList)
import Data.Array (bounds, indices, elems)
import Numeric (showHex)
-import Text.Show (show)
-import System.IO (IO, FilePath)
import GHC.Data.Strict qualified as Strict (Maybe, maybe)
import GHC.Data.FastString (unpackFS)
import GHC.Data.FlatBag (FlatBag, elemsFlatBag)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7598d0f5523bf258ca9071e595be8c0…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7598d0f5523bf258ca9071e595be8c0…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/sjakobi/T27521] ci: Reduce lint job setup costs
by Simon Jakobi (@sjakobi2) 22 Jul '26
by Simon Jakobi (@sjakobi2) 22 Jul '26
22 Jul '26
Simon Jakobi pushed to branch wip/sjakobi/T27521 at Glasgow Haskell Compiler / GHC
Commits:
cd9d0b54 by Simon Jakobi at 2026-07-22T16:19:27+02:00
ci: Reduce lint job setup costs
Avoid fetching unnecessary history and submodules for lightweight lint
jobs. Run changelog validation without Hadrian.
Because the lint-author job is now based on the .lint template directly,
we enhance it to allow Git to read from the runner-owned checkouts,
In the previously used .lint-params template, this permissions issue was
addressed via `chown`.
Closes #27521.
Assisted-by: gpt-5.6-sol via Codex CLI
- - - - -
3 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- hadrian/src/Rules/Test.hs
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -134,6 +134,10 @@ workflow:
stage: tool-lint
tags:
- lint
+ before_script:
+ # Allow Git to read from the runner-owned checkout. This is needed
+ # for example by the lint-author job.
+ - git config --global --add safe.directory "$CI_PROJECT_DIR"
rules:
- *drafts-can-fail-lint
- when: always
@@ -251,29 +255,16 @@ ghc-linters:
lint-changelog:
stage: tool-lint
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
- extends: .lint-params
+ extends: .lint
variables:
- BUILD_FLAVOUR: default
CHANGELOG_EXPECT_MR: "$CI_MERGE_REQUEST_IID"
+ GIT_DEPTH: 1
+ GIT_SUBMODULE_STRATEGY: none
+ before_script:
+ - export PATH="/opt/toolchain/bin:$PATH"
+ - git config --global --add safe.directory "$CI_PROJECT_DIR"
script:
- # Cancel the job if there is a no-changelog label
- - |
- [[ ",${CI_MERGE_REQUEST_LABELS}," == *",no-changelog,"* ]] && exit 0
- # Check that the MR adds at least one changelog entry
- - git fetch "$CI_MERGE_REQUEST_PROJECT_URL" "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
- - base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
- - added=$(git diff --name-only --diff-filter=A "$base..$CI_COMMIT_SHA" -- 'changelog.d/' | grep -v '^changelog.d/config$' || true)
- - |
- if [ -z "$added" ]; then
- echo "ERROR: No changelog entry found in changelog.d/"
- echo "Please add a changelog entry file describing your user-facing changes."
- echo "If this MR does not need a changelog entry, apply the 'no-changelog' label."
- exit 1
- fi
- - echo "Found changelog entries:" $added
- # Build changelog-d and validate all entries (checks required fields, section names, MR number)
- - .gitlab/ci.sh configure
- - .gitlab/ci.sh run_hadrian test --test-root-dirs="testsuite/tests/linters" --only=changelog-d
+ - .gitlab/ci.sh lint_changelog
dependencies: []
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/'
@@ -285,6 +276,9 @@ lint-changelog:
lint-linters:
image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
extends: .lint
+ variables:
+ GIT_DEPTH: 1
+ GIT_SUBMODULE_STRATEGY: none
script:
- mypy testsuite/tests/linters/regex-linters/*.py
dependencies: []
@@ -293,6 +287,9 @@ lint-linters:
lint-testsuite:
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
extends: .lint
+ variables:
+ GIT_DEPTH: 1
+ GIT_SUBMODULE_STRATEGY: none
script:
- make -Ctestsuite list_broken TEST_HC=$GHC
dependencies: []
@@ -301,6 +298,9 @@ lint-testsuite:
typecheck-testsuite:
image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
extends: .lint
+ variables:
+ GIT_DEPTH: 1
+ GIT_SUBMODULE_STRATEGY: none
script:
- mypy testsuite/driver/runtests.py
dependencies: []
@@ -323,14 +323,13 @@ typecheck-testsuite:
- _build/stageBoot/bin/lint-submodule-refs . $(git rev-list $base..$CI_COMMIT_SHA)
dependencies: []
-# We allow the submodule checker to fail when run on merge requests (to
-# accommodate, e.g., haddock changes not yet upstream) but not on `master` or
-# Marge jobs.
+# Check that commits in an MR were not authored with the identity that CI uses
+# when it needs to create commits itself. This only needs Git history.
lint-author:
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
- extends: .lint-params
+ extends: .lint
variables:
- BUILD_FLAVOUR: default
+ GIT_SUBMODULE_STRATEGY: none
script:
- git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
=====================================
.gitlab/ci.sh
=====================================
@@ -57,6 +57,7 @@ Common Modes:
save_cache Preserve the cabal cache
build_hadrian Build GHC via the Hadrian build system
test_hadrian Test GHC via the Hadrian build system
+ lint_changelog Check that an MR adds a valid changelog entry
Environment variables affecting the build:
@@ -971,6 +972,49 @@ function lint_author(){
done
}
+function lint_changelog() {
+ # Cancel the job if there is a no-changelog label.
+ if [[ ",${CI_MERGE_REQUEST_LABELS:-}," == *",no-changelog,"* ]]; then
+ exit 0
+ fi
+
+ # Check that the MR adds at least one changelog entry.
+ git fetch --depth=1 \
+ "$CI_MERGE_REQUEST_PROJECT_URL" \
+ "$CI_MERGE_REQUEST_DIFF_BASE_SHA"
+
+ local added
+ added=$(git diff --name-only --diff-filter=A \
+ "$CI_MERGE_REQUEST_DIFF_BASE_SHA..$CI_COMMIT_SHA" -- \
+ 'changelog.d/' | grep -v '^changelog.d/config$' || true)
+
+ if [ -z "$added" ]; then
+ error "No changelog entry found in changelog.d/"
+ echo "Please add a changelog entry file describing your user-facing changes."
+ echo "If this MR does not need a changelog entry, apply the 'no-changelog' label."
+ exit 1
+ fi
+ echo "Found changelog entries: $added"
+
+ # Build changelog-d with the bootstrap compiler and validate all entries
+ # (checks required fields, section names, and the MR number).
+ local changelog_build_dir
+ changelog_build_dir="$(mktemp -d)"
+ "$GHC" -Werror \
+ -package base \
+ -package bytestring \
+ -package Cabal-syntax \
+ -package containers \
+ -package directory \
+ -package filepath \
+ -package pretty \
+ -outputdir "$changelog_build_dir" \
+ -o "$changelog_build_dir/changelog-d" \
+ utils/changelog-d/ChangelogD.hs
+ "$changelog_build_dir/changelog-d" \
+ changelog.d/ --validate --expect-mr "$CHANGELOG_EXPECT_MR"
+}
+
function abi_of(){
DIR=$(realpath $1)
mkdir -p "$OUT"
@@ -1085,6 +1129,7 @@ case ${1:-help} in
perf_test) run_perf_test ;;
abi_test) abi_test ;;
cabal_test) cabal_test ;;
+ lint_changelog) lint_changelog ;;
lint_author) shift; lint_author "$@" ;;
compare_interfaces_of) shift; compare_interfaces_of "$@" ;;
clean) clean ;;
=====================================
hadrian/src/Rules/Test.hs
=====================================
@@ -89,6 +89,8 @@ checkPrograms =
, CheckProgram "lint:notes" noteLinterProgPath noteLinterSourcePath noteLinterExtra lintNotes (const stage0Boot) id
, CheckProgram "lint:codes" codeLinterProgPath codeLinterSourcePath codeLinterExtra lintCodes id id
, CheckProgram "lint:whitespace" whitespaceLinterProgPath whitespaceLinterSourcePath whitespaceLinterExtra lintWhitespace (const stage0Boot) (filter (/= lintersCommon))
+ -- N.B. The lint:changelog build is replicated by lint_changelog in
+ -- .gitlab/ci.sh. Keep its package dependencies in sync with this target.
, CheckProgram "lint:changelog" changelogDProgPath changelogDSourcePath changelogDExtra changelogD (const stage0Boot) id
]
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cd9d0b54583e37e518c7a121cae7aa1…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cd9d0b54583e37e518c7a121cae7aa1…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/fendor/external-unit-db-cache] 49 commits: driver: enable -finter-module-far-jumps by default
by Hannes Siebenhandl (@fendor) 22 Jul '26
by Hannes Siebenhandl (@fendor) 22 Jul '26
22 Jul '26
Hannes Siebenhandl pushed to branch wip/fendor/external-unit-db-cache at Glasgow Haskell Compiler / GHC
Commits:
57c0f32c by mangoiv at 2026-07-10T11:08:38-04:00
driver: enable -finter-module-far-jumps by default
this fixes a compatibility bug with certain binutils/gcc versions where
we were seeing jump offset overflow errors.
This commit can probably reverted if we stop supporting the problematic
binutils/gcc verions (2.44 and 14.2, respectively)
Reolves #26994
- - - - -
4396a6f2 by Andrea Vezzosi at 2026-07-10T11:09:25-04:00
[Fix #27287] preserve ModBreaks in ModIface
- - - - -
ed261a7e by Cheng Shao at 2026-07-14T17:59:38-04:00
hadrian: fix HLS support
This patch fixes hadrian's HLS support so one can rely on HLS when
working on the hadrian codebase. Fixes #27480.
Not building/linking shared libraries for hadrian is a severely
premature optimization; this top-level setting in `cabal.project` only
affects home packages while the dependencies in the cabal store are
built with vanilla/dynamic anyway, and even adding dynamic builds to
home packages would not be costly due to cabal's usage of
`-dynamic-too`.
- - - - -
eee8ec5b by Cheng Shao at 2026-07-14T18:00:20-04:00
compiler: fix miscompiled %load_relaxed, add missing %store_relaxed
This patch fixes the %load_relaxed cmm primop compilation logic to
correctly use relaxed memory ordering, and adds the missing
%store_relaxed primop. Parsing logic of %load/%store with explicit
ordering is covered in the AtomicFetch test case. Fixes #27483.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
1718230f by Alan Zimmerman at 2026-07-14T18:01:06-04:00
EPA: Keep binds and sigs together in HsValBindsLR
We combine them into a single list for GhcPs, wrapped in the
ValBind data type, which is the bind equivalent of ValD, having
constructors for binds and sigs.
This simplifies exact print processing, especially when using it to
update the contents of local binds, as we no longer need AnnSortKey
BindTag
- - - - -
6bd1ad2a by Andreas Klebinger at 2026-07-14T18:01:49-04:00
Bump nofib submodule to account for MonoLocalBinds.
New versions of GHC enable MonoLocalBinds by default.
This breaks some of the benchmarks. I've fixed this and
this bump pulls in that fix.
- - - - -
7eb0f1c9 by Cheng Shao at 2026-07-14T18:02:31-04:00
testsuite: fix bytecodeIPE test under +ipe flavours
This patch fixes the bytecodeIPE test under +ipe flavours. It used to
fail under +ipe because the RTS is built with IPE info, then
stg_AP_info in RTS carries IPE info, so whereFrom wouldn't return
Nothing. Now the test checks IPE info of a datacon in the ghci-loaded
module which is not affected by whether the RTS is built with IPE info
or not. Fixes #27498.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
ef038aae by cydparser at 2026-07-15T04:35:41-04:00
Reduce bytes allocated for `capabilities` in RTS (fixes #27487)
In rts/Capability.c, `capabilities` is an array of pointers, but it was allocated as if it were an
array of Capability's.
- - - - -
d377e83e by Cheng Shao at 2026-07-15T04:36:27-04:00
rts: fix missing UNTAG in stg_readTVarIOzh
This patch fixes missing UNTAG on the current value closure read from
StgTVar. UNTAG is a no-op when it's stg_TREC_HEADER_info which is word
aligned; it may be a tagged closure, and reading info table from the
tagged address is an unaligned load which may cause issues on
platforms with strict alignment requirements.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
8ed03842 by Cheng Shao at 2026-07-15T04:36:27-04:00
rts: fix missing UNTAG in stg_control0zh_ll
This patch fixes missing UNTAG on the cont closure returned by
captureContinuationAndAbort. In case it's not NULL,
captureContinuationAndAbort returns a tagged StgContinuation closure,
in which case it must be untagged before accessing the
apply_mask_frame field.
In the past it worked out of luck: when apply_mask_frame was NULL then
mask_frame_offset is also 0 so the control flow didn't diverge to a
wrong path. Still, this is horribly wrong and will crash once
StgContinuation struct is refactored and fields are shuffled around.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
5aa7000a by Cheng Shao at 2026-07-15T04:37:08-04:00
compiler: fix redundant AP thunk codegen when not using -ticky-ap-thunk
This patch fixes a double negation confusion in !7525 that results in
some redundant AP thunk code generation when not using
-ticky-ap-thunk. Now, we use `stgToCmmUseStdApThunk` to indicate
whether precomputed AP thunks in the RTS should be used, which
defaults to `True`, unless `-ticky-ap-thunk` is passed.
`-finfo-table-map` now also implies `-ticky-ap-thunk`, since when
doing IPE profiling we want the generated AP thunks to be unique.
Fixes #27502.
-------------------------
Metric Decrease:
T3064
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
d43a7b7a by Brian McKenna at 2026-07-15T20:10:04+02:00
Strip ticks when desugaring bool guards
The special `considerAccessible` pattern was broken when compiling
with debug info. Compiling with debug info wraps expressions with
`SourceNote` ticks, which broke the internals of the
`desugarBoolGuard` function. Ticks are now ignored within this
function.
Fixes #27360
- - - - -
ede4b17b by Ben Gamari at 2026-07-15T22:59:53-04:00
base: Display ExceptionContext in WhileHandling's textual description
As originally-implemented the implementation for
`WhileHandling(displayExceptionAnnotation)` would display the
`ExceptionContext` of the exception which it carries (as this was the
behavior of `displayException`, in terms of which
`displayExceptionAnnotation` was implemented).
However, in 284ffab3 the definition of `SomeException(displayException)`
was changed to exclude the `ExceptionContext`. This means that
`WhileHandling(displayExceptionAnnotation)` fails to describe the
provenance of the exception which it captures, greatly limiting its
utility.
Return the implementation to its originally-specified behavior by
implementing `WhileHandling(displayExceptionAnnotation)` in terms of
`displayExceptionWithInfo`.
Fixes #27456.
- - - - -
0f64f348 by Cheng Shao at 2026-07-16T15:41:08+00:00
ci: add missing docker permission workaround in abi-test job
- - - - -
660cb239 by Cheng Shao at 2026-07-16T19:37:48+00:00
bindist: Fix make install -j race condition on macos/freebsd
This patch fixes make install -j race condition on macos/freebsd. BSD
install fails with EEXIST when multiple install processes concurrently
create the same prefix directory. So we add an `install_dirs`
prerequisite job that sequentially creates the directories for
subsequent jobs to work with. Fixes #27499.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
08130257 by Cheng Shao at 2026-07-16T19:37:48+00:00
ci: run bindist make install with -j
This patch makes the ci scripts run `make install` with `-j` to reduce
wall clock time when installing the bindist, see related issue for
benchmark numbers. This only affects ghc ci logic, the user-facing
default is up to distributors and is still `-j1`. Closes #27029.
- - - - -
d5ae6906 by Adam Gundry at 2026-07-17T04:57:43-04:00
Mark various language extension flags as deprecated (see #27329)
The following language extensions are now deprecated:
- AlternativeLayoutRule
- AlternativeLayoutRuleTransitional
- ParallelArrays
- PolymorphicComponents
- Rank2Types
In addition, the warning `-Walternative-layout-rule-transitional`
has been marked as deprecated, as it is emitted only under the
deprecated extension `XAlternativeLayoutRuleTransitional`.
- - - - -
fe3b059c by Andrew Lelechenko at 2026-07-17T04:58:26-04:00
base: re-export GHC.Environment.getFullArgs from System.Environment
CLC proposal https://github.com/haskell/core-libraries-committee/issues/431
- - - - -
722236dd by sheaf at 2026-07-18T08:48:31-04:00
Coercion optimisation: avoid double-Sym for InstCo
Ticket #27374 pointed out an issue with GHC.Core.Coercion.Opt.optCoercion's
handling of InstCo: it contravened (LC2) in Note [The LiftingContext in optCoercion]
because it applied the ambient 'sym' to a coercion that was then added
to the lifting context substitution.
Fixes #27374
Co-authored-by: Simon Jakobi <simon.jakobi(a)gmail.com>
- - - - -
ff70fc75 by sheaf at 2026-07-18T08:48:31-04:00
Coercion optimisation: avoid exponential behaviour
The change to coercion optimisation of 'InstCo' in the previous commit
introduces exponential behaviour to the coercion optimiser. To avoid
this, this commit provides a way to push in 'Sym' of an already-optimised
coercion: GHC.Core.Coercion.Opt.mkDeepSymCo.
See Note [Pushing Sym without re-optimising] in GHC.Core.Coercion.Opt.
- - - - -
dfef27f0 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Move THREADED_RTS-conditional struct members to end of Capability
Accessing members of the Capability struct from CMM code rely on
accessor macros. (The macros are generated by deriveConstants).
These macros have a single definition. This means that the offsets of
all struct members must *not* vary based on THREADED_RTS vs
!THREADED_RTS. This requires that any struct members that are
conditional on THREADED_RTS must occur after the unconditional struct
members. Hence we move all the ones that are conditional on
THREADED_RTS to the end.
Add a deriveConstants entry for the iomgr member of the Capability
struct, which was the motivation for this change.
Add warning messages to help our future selves. Debugging this took me
a couple hours in gdb!
- - - - -
c254e022 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Make the IOManager API use CapIOManager rather than Capability
This makes the API somewhat more self-contained and more consistent.
Now the IOManager API and each of the backends takes just the I/O
manager structure. Previously we had a bit of a mixture, depending on
whether the function needed access to the Capability or just the
CapIOManager.
We still need access to the cap, so we introduce a back reference to
reach the capability, via iomgr->cap.
Convert all uses in select and poll backends, but not win32 ones.
Convert callers in the scheduler and elsewhere.
Also convert the three CMM primops that call IOManager APIs. They just
need to use Capability_iomgr(MyCapability()).
- - - - -
4f3d8f31 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Split posix/MIO.c out of posix/Signals.c
The MIO I/O manager was secretly living inside the Signals file.
Now it gets its own file, like any other self-respecting I/O manager.
- - - - -
52ce04a9 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Rationalise some scheduler run queue utilities
Move them all to the same place in the file.
Make some static that were used only internally.
Also remove a redundant assignment after calling truncateRunQueue that
is already done within truncateRunQueue.
- - - - -
75bbdebc by Duncan Coutts at 2026-07-18T08:49:12-04:00
Rename initIOManager{AfterFork} to {re}startIOManager
These are more accurate names, since these actions happen after
initialisation and are really about starting (or restarting) background
threads.
- - - - -
724c0517 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Free per-cap I/O managers during shutdown and forkProcess
Historically this was not strictly necessary. The select and win32
legacy I/O managers did not maintain any dynamically allocated
resources. The new poll one does (an auxillary table), and so this
should be freed.
After forkProcess, all threads get deleted. This includes threads
waiting on I/O or timers. So as of this patch, resetting the I/O
manager is just about tidying things up. For example, for the poll
I/O manager this will reset the size of the AIOP table (which
otherwise grows but never shrinks).
In future however the re-initialising will become neeecessary for
functionality, since some I/O managers will need to re-initialise
wakeup fds that are set CLOEXEC.
- - - - -
c007d122 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add a TODO to the MIO I/O manager
The direction of travel is to make I/O managers per-capability and have
all their state live in the struct CapIOManager. The MIO I/O manager
however still has a number of global variables.
It's not obvious how handle these globals however.
- - - - -
b65ab7b3 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add a FIXME note in the Poll I/O manager
- - - - -
daf2bd6f by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add missing updateRemembSetPushClosure in poll I/O manager
For the non-moving GC.
- - - - -
e33ca830 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Minor doc improvement to struct StgAsyncIOOp member outcome
Mention the enumeration names, as well as their numeric values. The rest
of the code uses the enum names.
- - - - -
4edd2579 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Minor doc improvements for StgTSOBlockInfo
Clarify that certain union members are used only by certain legacy
I/O managers. Hopefully we will be able to remove these at some point.
- - - - -
536bedbb by Duncan Coutts at 2026-07-18T08:49:12-04:00
Avoid exporting various win32-specific rts symbols
The BeginPrivate.h / EndPrivate.h scheme works perfectly well on
Windows, but all of the rts/win32/*.h files were not using it.
- - - - -
8139b5ac by Duncan Coutts at 2026-07-18T08:49:12-04:00
Remove wakeupIOManager, ioManagerWakeup and setIOManagerWakeupFd
We no longer need wakeupIOManager for the threaded RTS case, so we can
remove it and the bits only needed to support it. This includes the
pipe/eventfd fd shared between the RTS and the in-library I/O manager
used for waking up the I/O manager thread. The pipe/eventfd still
exists, but it no longer has to be communicated to the RTS, since the
RTS no longer needs to use it.
So we remove the RTS API export setIOManagerWakeupFd, and remove uses of
it within the I/O managers in ghc-internal.
- - - - -
74fe7c66 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add a new interruptIOManager API for the I/O managers
It will be used to interrupt awaitCompletedTimeoutsOrIO. Also update the
return type and docs for awaitCompletedTimeoutsOrIO to have it return
false when it gets interrupted, and have no useful post condition in
that case.
- - - - -
38792843 by Duncan Coutts at 2026-07-18T08:49:13-04:00
Add interruptIOManager support for select I/O manager
Uses the FdWakup mechanism.
- - - - -
2f3b00aa by Duncan Coutts at 2026-07-18T08:49:13-04:00
Add interruptIOManager support for poll I/O manager
Uses the FdWakup mechanism.
A quirk we have to cope with is that we now need to poll one more fd --
the wakeup_fd_r -- but this fd has no corresponding entry in the
aiop_table. This is awkward since we have set up our aiop_poll_table to
be an auxilliary table with matching indicies.
The solution this patch uses (and described in the comments) is to have
two tables: struct pollfd *aiop_poll_table, *full_poll_table;
and to have the aiop_poll_table alias the tail of the full_poll_table.
The head entry in the full_poll_table is the extra fd. So we poll the
full_poll_table, while the aiop_poll_table still has matching indicies
with the aiop_table.
Hurrah for C aliasing rules.
- - - - -
cee50131 by Duncan Coutts at 2026-07-18T08:49:13-04:00
Add interruptIOManager support for win32 legacy I/O manager
And remove unused related helper resetAbandonRequestWait. It is not
called because the event is created in auto-reset mode, so never needs
to be reset manually.
- - - - -
cf453143 by Duncan Coutts at 2026-07-18T08:49:13-04:00
Note lack of interruptIOManager support for WinIO I/O manager
Though there's a plausible design, we can't sanely test it at the moment
due to related WinIO bugs. Filed as issue #27403.
- - - - -
1b74a0ad by Duncan Coutts at 2026-07-18T08:49:13-04:00
Be more explicit about enum IOReadOrWrite values, and type within cmm
Belt and braces.
- - - - -
b388d093 by Brian McKenna at 2026-07-18T17:51:50-04:00
Ignore ticks in the pattern-match term oracle
The term-oracle in the pattern-match checker is keyed by a canonical
form of the scrutinee, computed by `makeDictsCoherent`. That canonical
form was tick-sensitive: two occurrences of an otherwise identical
expression that happened to carry different ticks were treated as
distinct values, breaking long-distance information.
This shows up in practice under `-finfo-table-map`, because the
desugarer wraps every record-selector use site in a `SourceNote`
carrying that site's span. For example:
data Box = Box { unBox :: Maybe Int }
f b = case unBox b of
Nothing -> 0
Just _ -> let Just x = unBox b in x
The two `unBox b` expressionss carry different SourceNote spans, the
pattern-match checker sees them as different, the long-distance
information from the outer `Just _` branch never reaches the
let-pattern, and `Just x = unBox b` is wrongly reported as
non-exhaustive.
We now strip all ticks in `makeDictsCoherent`. This is documented as
Wrinkle (UD1) of Note [Unique dictionaries in the TmOracle CoreMap].
Fixes #27314
- - - - -
c23e1acb by Mrjtjmn at 2026-07-18T17:52:45-04:00
Add explanations for unsolved Typeable constraints
This commit adds explanations for unsolved 'Typeable' constraints.
GHC will now provide additional explanations for an unsolved constraint
of the form 'Typeable ty', explain why GHC did not solve Typeable constraint.
e.g.:
- 'ty' is a polymorphic type (e.g. forall a. a -> a)
- 'ty' is a qualified type (e.g. Eq Int => Int)
- 'ty' is an unboxed sum type
- 'ty' is an unreduced type family application
- 'ty' whose kind is not typeable
Fixes #26532
- - - - -
cbef021e by Artem Pelenitsyn at 2026-07-19T07:49:55-04:00
ghc-internal: Lock.hs: fix typo and indentation
- - - - -
42918646 by Duncan Coutts at 2026-07-19T07:50:36-04:00
Fix failing test GcStaticPointers for non-moving GC
Minor mistake in asserting something before checking for that same
thing.
Specifically, Bdescr asserts HEAP_ALLOCED_GC, but Bdescr was being used
prior to a guard that checks HEAP_ALLOCED_GC. The solution is just to
move the use of Bdescr after the guard.
Thanks to Simon Jakobi for identifying the problem.
- - - - -
c2f6dcd4 by Sasha Bogicevic at 2026-07-20T10:31:56+02:00
Improve error messages for invalid record wildcards
Record wildcard hints are now shown in more contexts and include
constructor arity; matching with `..` on a fieldless constructor
now produces a dedicated error message.
Fixes #21101
- - - - -
4c02e76b by Duncan Coutts at 2026-07-21T10:37:21-04:00
Mark test T27105 as fragile, citing issue #27522
Scheduler fairness is fine, except when it isn't. And it isn't on CI
machines surprisingly often! See the issue for details.
- - - - -
43dd2b15 by Recursion Ninja at 2026-07-21T17:09:53-04:00
Resolving many TTG related orphan type-class instances
This is part a technical debt removal effort made possible now
that separating out the AST via TTG has come to a close.
As the AST in 'L.H.S' has been incrementally separated from the GHC internals,
there are many accumulated orphan instance of 'Binary', 'NFData', 'Outputable',
and 'Uniquable'. The orphan instance of data-types from within 'L.H.S' have had
their orphan instances moved to either:
1. The module which defines the data-type
2. The module which defines the type-class;
i.e. moving an orphan 'Binary' instance to 'GHC.Utils.Binary'
Orphan instances resolved (37):
| Data-type | Resolved instance(s) | Former orphan module(s) |
| -------------------- | -------------------------- | ------------------------- |
| Role | Binary, NFData, Outputable | GHC.Core.Coercion.Axiom |
| SrcStrictness | Binary, NFData, Outputable | GHC.Core.DataCon |
| SrcUnpackedness | Binary, NFData, Outputable | GHC.Core.DataCon |
| Fixity | Binary, Outputable | GHC.Hs.Basic |
| FixityDirection | Binary, Outputable | GHC.Hs.Basic |
| LexicalFixity | Outputable | GHC.Hs.Basic |
| CCallTarget | NFData | GHC.Hs.Decls.Foreign |
| CType | NFData | GHC.Hs.Decls.Foreign |
| Header | NFData | GHC.Hs.Decls.Foreign |
| OverlapMode | Binary, NFData | GHC.Hs.Decls.Overlap |
| WithHsDocIdentifiers | NFData, Outputable | GHC.Hs.Doc |
| HsDocString | NFData | GHC.Hs.DocString |
| HsDocStringChunk | Binary, Outputable | GHC.Hs.DocString |
| HsDocStringDecorator | Binary, Outputable | GHC.Hs.DocString |
| NamespaceSpecifier | Outputable | GHC.Hs.ImpExp |
| ForAllTyFlag | Binary, NFData, Outputable | GHC.Hs.Specificity |
| Specificity | Binary, NFData | GHC.Hs.Specificity |
| PromotionFlag | Binary, Outputable | GHC.Types.Basic |
| FieldLabelString | Outputable, Uniquable | GHC.Types.FieldLabel |
| InlinePragma | Binary | GHC.Types.InlinePragma |
-------------------------
Metric Decrease:
hard_hole_fits
-------------------------
Closes #21262, #27469
- - - - -
ab9ab895 by Cheng Shao at 2026-07-21T17:10:53-04:00
rts: always use StgInt to represent cost center id
Currently cost center id is modeled as `Int` and it should be `StgInt`
uniformly in the RTS, hence this patch. Fixes #27524.
- - - - -
a1326b0b by fendor at 2026-07-22T16:27:28+02:00
Introduce global unit database cache
As a first step for better sharing of `UnitInfo` across `UnitEnv`,
we introduce a new datatype called `ExternalUnitDatabases`.
It primarily serves as an in-memory representation of *all*
`UnitDatabase`s across `UnitEnv`. This means, if multiple `HomeUnitEnv`s
depend on the same database, one way or another, we make sure that we
don't parse from disk every time.
Instead, we store the in-memory representation in `ExternalUnitDatabases`.
`ExternalUnitDatabaseCache` is the equivalent of `ExternalUnitState` in
the `UnitEnv`. It is a mutable variable wrapping `ExternalUnitDatabases`.
The mutable `ExternalUnitDatabaseCache` is used in `initUnits` to make
sure we don't parse the same unit database multiple times.
Almost by accident, we change the semantics of `initUnits` to honour
modifications to `packageDBFlags`.
The inability to change `packageDBFlags` while also reusing the already
parsed `UnitDatabase`s was reported in #26423 as a bug.
Hence, we think this behaviour change is warranted and acceptable,
especially since it comes with a breaking change to the `initUnits` API.
Add regression test for #26423
Closes #26423
- - - - -
88b39e7c by fendor at 2026-07-22T16:27:28+02:00
Introduce UnitIndex for global external unit caching
`UnitInfo`s have been observed to cause a lot of memory usage in #27500.
Especially with multiple home units, as the same (external) units are
processed from scratch, even though most of the time we end up with
exactly the same `UnitInfo`.
We introduce a `UnitEnv` global cache that allows us to store external
unit information that is used across all `HomeUnitEnv`s.
The most important change in this commit is the introduction of the `UnitIndex`.
It stores a global mapping of `UnitId` -> `UnitInfo`, and `initUnits`
always uses the cached `UnitInfo` entry to populate each
`HomeUnitEnv`'s `UnitState`.
This allows us to ensure the following property:
> Each `UnitInfo` should be alive exactly once in GHC.
In addition, the `ExternalUnitDatabaseCache` may also hold a reference
to each on-disk representation of `UnitInfo`.
This means, we impose an hard upper bound on the number of `UnitInfo`s
alive in the GHC session:
> The number of alive `UnitInfo`s closure objects must be the
> sum of all loaded unit database times two.
We add performance regression tests that make sure the number of live
`UnitInfo` cannot exceed this threshold.
Closes #27500
-------------------------
Metric Decrease:
MultiComponentModules
MultiComponentModulesRecomp
MultiComponentModulesRecomp100
mhu-perf
-------------------------
These metrics increases are especially notable, as we are not even
sharing anything big but merely the global package database with 50
entries.
It shows how careful sharing of `UnitInfo` can improve memory usage.
We expect this to be much more notable when the whole cabal package
database is shared across multiple home units.
---
Technical details
To share the `UnitInfo`s correctly, it is important that we extract
the `WireMap` into the `UnitIndex`. At the moment of writing, `WireMap`
must be globally the same for all `HomeUnitEnv`s.
This is important, as we could otherwise not cache the "fully-resolved"
`UnitInfo`.
We consider a `UnitInfo` fully-resolved, if wired-in units have been
updated, the `UnitInfo` has been validated and variables in the unit
config, such as `${pkgroot}` have been resolved.
Updating the wired-in units requires the `WireMap` to be globally the
same.
- - - - -
273 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- + changelog.d/21101
- + changelog.d/T26423
- + changelog.d/T26532
- + changelog.d/T27314.md
- + changelog.d/T27329
- + changelog.d/T27360
- + changelog.d/T27374
- + changelog.d/T27456
- + changelog.d/fix-cmm-atomic-load-store
- + changelog.d/fix-make-install-j
- + changelog.d/fix-use-std-ap-thunk
- + changelog.d/inter-module-far-jumps-aarch64-default
- + changelog.d/unit-index
- compiler/GHC.hs
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Config/StgToCmm.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main/Compile.hs
- compiler/GHC/Driver/Main/Hsc.hs
- compiler/GHC/Driver/Main/Interactive.hs
- compiler/GHC/Driver/Main/Passes.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Driver/Session/Units.hs
- compiler/GHC/Hs/Basic.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls/Overlap.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- − compiler/GHC/Hs/Specificity.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Breakpoints.hs
- + compiler/GHC/HsToCore/Breakpoints/Types.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Platform/Ways.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/Runtime/Eval.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Config.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/Types/Rank.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/FieldLabel.hs
- compiler/GHC/Types/Fixity.hs
- compiler/GHC/Types/ForeignCall.hs
- compiler/GHC/Types/GREInfo.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/InlinePragma.hs
- compiler/GHC/Types/Unique.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Unit/Env.hs
- + compiler/GHC/Unit/External/Database.hs
- + compiler/GHC/Unit/External/Index.hs
- + compiler/GHC/Unit/External/ModuleOrigin.hs
- + compiler/GHC/Unit/External/Providers.hs
- + compiler/GHC/Unit/External/Query.hs
- + compiler/GHC/Unit/External/Substitution.hs
- + compiler/GHC/Unit/External/Validate.hs
- + compiler/GHC/Unit/External/Visibility.hs
- + compiler/GHC/Unit/External/Wired.hs
- compiler/GHC/Unit/Home/Graph.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Unit/Module/ModGuts.hs
- compiler/GHC/Unit/Module/ModIface.hs
- compiler/GHC/Unit/Module/WholeCoreBindings.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Unit/State.hs-boot
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls/Foreign.hs
- compiler/Language/Haskell/Syntax/Doc.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Specificity.hs
- compiler/ghc.cabal.in
- docs/users_guide/expected-undocumented-flags.txt
- docs/users_guide/exts/rank_polymorphism.rst
- docs/users_guide/exts/static_pointers.rst
- docs/users_guide/using-optimisation.rst
- ghc/GHCi/UI.hs
- hadrian/bindist/Makefile
- hadrian/cabal.project
- hadrian/src/Rules/Generate.hs
- libraries/base/changelog.md
- libraries/base/src/System/Environment.hs
- libraries/base/tests/T15349.stderr
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Event/Control.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Manager.hs
- libraries/ghc-internal/src/GHC/Internal/Event/TimerManager.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock.hs
- libraries/ghc-internal/tests/backtraces/T14532b.stdout
- nofib
- rts/Capability.c
- rts/Capability.h
- rts/ContinuationOps.cmm
- rts/IOManager.c
- rts/IOManager.h
- rts/IOManagerInternals.h
- rts/PrimOps.cmm
- rts/Profiling.c
- rts/RaiseAsync.c
- rts/RtsStartup.c
- rts/RtsSymbols.c
- rts/Schedule.c
- rts/Schedule.h
- rts/Trace.c
- rts/Trace.h
- rts/eventlog/EventLog.c
- rts/eventlog/EventLog.h
- rts/include/rts/IOInterface.h
- rts/include/rts/storage/Closures.h
- rts/include/rts/storage/TSO.h
- rts/posix/FdWakeup.h
- + rts/posix/MIO.c
- + rts/posix/MIO.h
- rts/posix/Poll.c
- rts/posix/Poll.h
- rts/posix/Select.c
- rts/posix/Select.h
- rts/posix/Signals.c
- rts/posix/Signals.h
- rts/posix/Timeout.c
- rts/posix/Timeout.h
- rts/rts.cabal
- rts/sm/NonMovingMark.c
- rts/win32/AsyncMIO.c
- rts/win32/AsyncMIO.h
- rts/win32/AsyncWinIO.h
- rts/win32/AwaitEvent.c
- rts/win32/AwaitEvent.h
- rts/win32/ConsoleHandler.h
- rts/win32/MIOManager.h
- rts/win32/ThrIOManager.h
- rts/win32/WorkQueue.h
- rts/win32/veh_excn.h
- testsuite/tests/backpack/should_compile/T13149.bkp
- testsuite/tests/cmm/should_run/AtomicFetch.hs
- testsuite/tests/cmm/should_run/AtomicFetch_cmm.cmm
- testsuite/tests/codeGen/should_run/cgrun025.stderr
- testsuite/tests/concurrent/should_run/T27105.hs
- testsuite/tests/concurrent/should_run/all.T
- + testsuite/tests/corelint/T27374.hs
- testsuite/tests/corelint/all.T
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/determinism/determ017/A.hs
- + testsuite/tests/driver/T26423/Hello.hs
- + testsuite/tests/driver/T26423/Makefile
- + testsuite/tests/driver/T26423/T26423.hs
- + testsuite/tests/driver/T26423/T26423.stderr
- + testsuite/tests/driver/T26423/T26423.stdout
- + testsuite/tests/driver/T26423/all.T
- + testsuite/tests/driver/T26423/test/Test.hs
- + testsuite/tests/driver/T26423/test/test.pkg
- + testsuite/tests/driver/TUnitInfo/Foo.hs
- + testsuite/tests/driver/TUnitInfo/Makefile
- + testsuite/tests/driver/TUnitInfo/all.T
- + testsuite/tests/driver/TUnitInfo/genMhu.sh
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space-mhu.stdout
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space-single.stdout
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space.hs
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space.stdout
- testsuite/tests/exceptions/T26759.stderr
- testsuite/tests/ghc-e/should_fail/T18441fail7.stderr
- testsuite/tests/ghci/scripts/T12005.script
- testsuite/tests/ghci/scripts/bytecodeIPE.hs
- testsuite/tests/ghci/should_run/Makefile
- + testsuite/tests/ghci/should_run/T27287.hs
- + testsuite/tests/ghci/should_run/T27287.stdout
- testsuite/tests/ghci/should_run/all.T
- testsuite/tests/haddock/perf/Fold.hs
- testsuite/tests/indexed-types/should_fail/T7354.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/layout/layout001.stdout
- testsuite/tests/layout/layout002.stdout
- testsuite/tests/layout/layout003.stdout
- testsuite/tests/layout/layout004.stdout
- testsuite/tests/layout/layout005.stdout
- testsuite/tests/layout/layout006.stdout
- testsuite/tests/layout/layout007.stdout
- testsuite/tests/layout/layout008.stdout
- testsuite/tests/layout/layout009.stdout
- testsuite/tests/linear/should_compile/T1735Min.hs
- testsuite/tests/mdo/should_fail/mdofail006.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- + testsuite/tests/parser/should_compile/T13087.stderr
- testsuite/tests/parser/should_fail/T8431.stderr
- testsuite/tests/parser/should_fail/readFail038.stderr
- testsuite/tests/perf/compiler/T3064.hs
- + testsuite/tests/pmcheck/should_compile/T27314.hs
- + testsuite/tests/pmcheck/should_compile/T27360.hs
- testsuite/tests/pmcheck/should_compile/all.T
- testsuite/tests/polykinds/T7594.hs
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/programs/thurston-modular-arith/Main.hs
- + testsuite/tests/rename/should_fail/T21101.hs
- + testsuite/tests/rename/should_fail/T21101.stderr
- testsuite/tests/rename/should_fail/T9815.stderr
- testsuite/tests/rename/should_fail/T9815b.stderr
- testsuite/tests/rename/should_fail/T9815bghci.stderr
- testsuite/tests/rename/should_fail/T9815ghci.stderr
- testsuite/tests/rename/should_fail/all.T
- testsuite/tests/rts/ipe/IpeStats/Fold.hs
- testsuite/tests/runghc/T7859.stderr-mingw32
- testsuite/tests/simplCore/should_compile/T11562.hs
- testsuite/tests/simplCore/should_run/T3591.hs
- testsuite/tests/typecheck/should_compile/DeepSubsumption02.hs
- testsuite/tests/typecheck/should_compile/T12507.hs
- testsuite/tests/typecheck/should_compile/T13951.hs
- testsuite/tests/typecheck/should_compile/T18920.hs
- testsuite/tests/typecheck/should_compile/T2595.hs
- testsuite/tests/typecheck/should_compile/T7541.hs
- testsuite/tests/typecheck/should_fail/T15067.stderr
- + testsuite/tests/typecheck/should_fail/T26532.hs
- + testsuite/tests/typecheck/should_fail/T26532.stderr
- testsuite/tests/typecheck/should_fail/T6069.stderr
- testsuite/tests/typecheck/should_fail/T7368a.hs
- testsuite/tests/typecheck/should_fail/T9858b.stderr
- testsuite/tests/typecheck/should_fail/TcStaticPointersFail02.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_run/T1735_Help/Basics.hs
- testsuite/tests/typecheck/should_run/T3731-short.hs
- testsuite/tests/typecheck/should_run/T3731.hs
- testsuite/tests/typecheck/should_run/church.hs
- testsuite/tests/typecheck/should_run/tcrun008.hs
- testsuite/tests/typecheck/should_run/tcrun017.hs
- testsuite/tests/typecheck/should_run/tcrun026.hs
- testsuite/tests/typecheck/should_run/tcrun035.hs
- testsuite/tests/typecheck/should_run/tcrun036.hs
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
- utils/deriveConstants/Main.hs
- 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/c9d5e5318b4c9c1a2652b27fb079f4…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c9d5e5318b4c9c1a2652b27fb079f4…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
22 Jul '26
Rodrigo Mesquita pushed new branch wip/romes/27514 at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/27514
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/jeltsch/textual-bytecode-output] Switch to the `assert` from `GHC.Utils.Panic.Plain`
by Wolfgang Jeltsch (@jeltsch) 22 Jul '26
by Wolfgang Jeltsch (@jeltsch) 22 Jul '26
22 Jul '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/textual-bytecode-output at Glasgow Haskell Compiler / GHC
Commits:
f2f5df19 by Wolfgang Jeltsch at 2026-07-22T16:13:17+03:00
Switch to the `assert` from `GHC.Utils.Panic.Plain`
- - - - -
1 changed file:
- compiler/GHC/ByteCode/Show.hs
Changes:
=====================================
compiler/GHC/ByteCode/Show.hs
=====================================
@@ -7,7 +7,6 @@ module GHC.ByteCode.Show (showByteCode) where
import Prelude ((+), (-), Integral, div)
import Control.Arrow ((>>>))
-import Control.Exception (assert)
import Data.Eq ((==))
import Data.Ord ((>=))
import Data.Bits (FiniteBits, finiteBitSize)
@@ -38,6 +37,7 @@ import GHC.Types.Name.Occurrence (OccName)
import GHC.Types.Tickish (BreakTickIndex, BreakpointId (..))
import GHC.Types.SptEntry (SptEntry (..))
import GHC.Types.Error (MessageClass (MCDump))
+import GHC.Utils.Panic.Plain (assert)
import GHC.Utils.Logger (Logger, logMsg)
import GHC.Utils.Binary (BinSrcSpan (..))
import GHC.Utils.Encoding.UTF8 (utf8DecodeShortByteString, utf8DecodeByteString)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f2f5df1911658516bb5480facdbad5f…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f2f5df1911658516bb5480facdbad5f…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/sjakobi/T27521] ci: Reduce lint job setup costs
by Simon Jakobi (@sjakobi2) 22 Jul '26
by Simon Jakobi (@sjakobi2) 22 Jul '26
22 Jul '26
Simon Jakobi pushed to branch wip/sjakobi/T27521 at Glasgow Haskell Compiler / GHC
Commits:
923cb5f5 by Simon Jakobi at 2026-07-22T14:52:00+02:00
ci: Reduce lint job setup costs
Avoid fetching unnecessary history and submodules for lightweight lint
jobs. Run changelog validation without Hadrian.
Trust runner-owned checkouts so Git commands work when the container
user differs from the checkout owner, e.g. in the lint-author job.
Closes #27521.
Assisted-by: gpt-5.6-sol via Codex CLI
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -134,6 +134,9 @@ workflow:
stage: tool-lint
tags:
- lint
+ before_script:
+ # The checkout may be owned by the runner rather than the container user.
+ - git config --global --add safe.directory "$CI_PROJECT_DIR"
rules:
- *drafts-can-fail-lint
- when: always
@@ -251,18 +254,21 @@ ghc-linters:
lint-changelog:
stage: tool-lint
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
- extends: .lint-params
+ extends: .lint
variables:
- BUILD_FLAVOUR: default
CHANGELOG_EXPECT_MR: "$CI_MERGE_REQUEST_IID"
+ GIT_DEPTH: 1
+ GIT_SUBMODULE_STRATEGY: none
+ before_script:
+ - export PATH="/opt/toolchain/bin:$PATH"
+ - git config --global --add safe.directory "$CI_PROJECT_DIR"
script:
# Cancel the job if there is a no-changelog label
- |
[[ ",${CI_MERGE_REQUEST_LABELS}," == *",no-changelog,"* ]] && exit 0
# Check that the MR adds at least one changelog entry
- - git fetch "$CI_MERGE_REQUEST_PROJECT_URL" "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
- - base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
- - added=$(git diff --name-only --diff-filter=A "$base..$CI_COMMIT_SHA" -- 'changelog.d/' | grep -v '^changelog.d/config$' || true)
+ - git fetch --depth=1 "$CI_MERGE_REQUEST_PROJECT_URL" "$CI_MERGE_REQUEST_DIFF_BASE_SHA"
+ - added=$(git diff --name-only --diff-filter=A "$CI_MERGE_REQUEST_DIFF_BASE_SHA..$CI_COMMIT_SHA" -- 'changelog.d/' | grep -v '^changelog.d/config$' || true)
- |
if [ -z "$added" ]; then
echo "ERROR: No changelog entry found in changelog.d/"
@@ -271,9 +277,23 @@ lint-changelog:
exit 1
fi
- echo "Found changelog entries:" $added
- # Build changelog-d and validate all entries (checks required fields, section names, MR number)
- - .gitlab/ci.sh configure
- - .gitlab/ci.sh run_hadrian test --test-root-dirs="testsuite/tests/linters" --only=changelog-d
+ # Build changelog-d with the bootstrap compiler and validate all entries
+ # (checks required fields, section names, and the MR number).
+ - |
+ changelog_build_dir="$(mktemp -d)"
+ ghc -Werror \
+ -package base \
+ -package bytestring \
+ -package Cabal-syntax \
+ -package containers \
+ -package directory \
+ -package filepath \
+ -package pretty \
+ -outputdir "$changelog_build_dir" \
+ -o "$changelog_build_dir/changelog-d" \
+ utils/changelog-d/ChangelogD.hs
+ "$changelog_build_dir/changelog-d" \
+ changelog.d/ --validate --expect-mr "$CHANGELOG_EXPECT_MR"
dependencies: []
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/'
@@ -285,6 +305,9 @@ lint-changelog:
lint-linters:
image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
extends: .lint
+ variables:
+ GIT_DEPTH: 1
+ GIT_SUBMODULE_STRATEGY: none
script:
- mypy testsuite/tests/linters/regex-linters/*.py
dependencies: []
@@ -293,6 +316,9 @@ lint-linters:
lint-testsuite:
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
extends: .lint
+ variables:
+ GIT_DEPTH: 1
+ GIT_SUBMODULE_STRATEGY: none
script:
- make -Ctestsuite list_broken TEST_HC=$GHC
dependencies: []
@@ -301,6 +327,9 @@ lint-testsuite:
typecheck-testsuite:
image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
extends: .lint
+ variables:
+ GIT_DEPTH: 1
+ GIT_SUBMODULE_STRATEGY: none
script:
- mypy testsuite/driver/runtests.py
dependencies: []
@@ -323,14 +352,13 @@ typecheck-testsuite:
- _build/stageBoot/bin/lint-submodule-refs . $(git rev-list $base..$CI_COMMIT_SHA)
dependencies: []
-# We allow the submodule checker to fail when run on merge requests (to
-# accommodate, e.g., haddock changes not yet upstream) but not on `master` or
-# Marge jobs.
+# Check that commits in an MR were not authored with the identity that CI uses
+# when it needs to create commits itself. This only needs Git history.
lint-author:
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
- extends: .lint-params
+ extends: .lint
variables:
- BUILD_FLAVOUR: default
+ GIT_SUBMODULE_STRATEGY: none
script:
- git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/923cb5f55cad42720742b7eccfb23dc…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/923cb5f55cad42720742b7eccfb23dc…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/27532] UniqueDFM: alter should preserve insertion order
by Zubin (@wz1000) 22 Jul '26
by Zubin (@wz1000) 22 Jul '26
22 Jul '26
Zubin pushed to branch wip/27532 at Glasgow Haskell Compiler / GHC
Commits:
498f5057 by Zubin Duggal at 2026-07-22T18:11:53+05:30
UniqueDFM: alter should preserve insertion order
Before it always inserting new elements at the end.
This is problematic because instances get inserted into the map with
`alterF`, which can change ordering of how instances are printed
with `:info` depending on the order in which we consult interfaces
I expect `alter id k = id` and `alter (fmap f) k = adjust f k`. Moving keys to
the end breaks that (`adjust` already preserves position).
Fixes #27532
- - - - -
28 changed files:
- + changelog.d/27532
- compiler/GHC/Types/Unique/DFM.hs
- testsuite/tests/ghci/T16793/T16793.stdout
- testsuite/tests/ghci/T18060/T18060.stdout
- + testsuite/tests/ghci/T27532/Makefile
- + testsuite/tests/ghci/T27532/T27532.stdout
- + testsuite/tests/ghci/T27532/T27532j4.stdout
- + testsuite/tests/ghci/T27532/a.script
- + testsuite/tests/ghci/T27532/all.T
- + testsuite/tests/ghci/T27532/b.script
- + testsuite/tests/ghci/T27532/genT27532Modules
- testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
- testsuite/tests/ghci/scripts/T4175.stdout
- testsuite/tests/ghci/scripts/T8469.stdout
- testsuite/tests/ghci/scripts/T8535.stdout
- testsuite/tests/ghci/scripts/T9881.stdout
- testsuite/tests/ghci/scripts/ghci020.stdout
- testsuite/tests/ghci/scripts/ghci064.stdout
- testsuite/tests/ghci/should_run/T10145.stdout
- testsuite/tests/ghci/should_run/T18594.stdout
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
- testsuite/tests/roles/should_compile/Roles14.stderr
- testsuite/tests/roles/should_compile/Roles3.stderr
- testsuite/tests/roles/should_compile/Roles4.stderr
- testsuite/tests/roles/should_compile/T8958.stderr
- testsuite/tests/typecheck/should_compile/T18406b.stderr
- testsuite/tests/typecheck/should_compile/T18529.stderr
- testsuite/tests/typecheck/should_fail/T5300.stderr
Changes:
=====================================
changelog.d/27532
=====================================
@@ -0,0 +1,9 @@
+section: compiler
+synopsis: Make instance ordering in :info output stable
+description:
+ Updating an existing key in a UniqDFM no longer moves it to the end of the
+ iteration order. Previously the order of instances printed by :info depended
+ on the order in which interfaces were loaded, so it could change after
+ unrelated imports and differ between compiler builds.
+mrs: !16385
+issues: #27532
=====================================
compiler/GHC/Types/Unique/DFM.hs
=====================================
@@ -91,6 +91,23 @@ import qualified GHC.Data.Word64Set as W
-- If the client of the map performs operations on the map in deterministic
-- order then `udfmToList` returns them in deterministic order.
--
+-- More precisely, the order is insertion order. A key takes its position
+-- when it is added to the map after being absent. Operations that modify
+-- the value at an existing key (addToUDFM, adjustUDFM, alterUDFM, ...) do
+-- not move it. Deleting a key and adding it back moves it to the end.
+--
+-- In particular the order does not depend on how existing entries were
+-- updated. This makes alterUDFM consistent with addToUDFM and adjustUDFM,
+-- so that for example alterUDFM id k = id.
+--
+-- It also keeps the order stable for maps whose entries are updated many
+-- times. The instance environments are the main example: inserting an
+-- instance updates the entry of its class in a DNameEnv, and when updates
+-- moved keys to the end the order of instances shown by :info depended on
+-- the order in which interfaces happened to be loaded (#27532). Now a
+-- class keeps its place once its first instance is added, so loading
+-- further interfaces cannot change the order.
+--
-- There is an implementation cost: each element is given a serial number
-- as it is added, and `udfmToList` sorts its result by this serial
-- number. So you should only use `UniqDFM` if you need the deterministic
@@ -108,7 +125,8 @@ import qualified GHC.Data.Word64Set as W
--
-- There's more than one way to implement this. The implementation here tags
-- every value with the insertion time that can later be used to sort the
--- values when asked to convert to a list.
+-- values when asked to convert to a list. Updating an existing key keeps
+-- the old tag.
--
-- An alternative would be to have
--
@@ -169,11 +187,13 @@ emptyUDFM = UDFM M.empty 0
unitUDFM :: Uniquable key => key -> elt -> UniqDFM key elt
unitUDFM k v = UDFM (M.singleton (getKey $ getUnique k) (TaggedVal v 0)) 1
--- The new binding always goes to the right of existing ones
+-- A new key goes to the right of existing ones
+-- Overwriting an existing key keeps its position in the iteration order
addToUDFM :: Uniquable key => UniqDFM key elt -> key -> elt -> UniqDFM key elt
addToUDFM m k v = addToUDFM_Directly m (getUnique k) v
--- The new binding always goes to the right of existing ones
+-- A new key goes to the right of existing ones
+-- Overwriting an existing key keeps its position in the iteration order
addToUDFM_Directly :: UniqDFM key elt -> Unique -> elt -> UniqDFM key elt
addToUDFM_Directly (UDFM m i) u v
= UDFM (MS.insertWith tf (getKey u) (TaggedVal v i) m) (i + 1)
@@ -435,7 +455,8 @@ adjustUDFM_Directly f (UDFM m i) k = UDFM (M.adjust (fmap f) (getKey k) m) i
-- | The expression (@'alterUDFM' f map k@) alters value x at k, or absence
-- thereof. 'alterUDFM' can be used to insert, delete, or update a value in
-- UniqDFM. Use addToUDFM, delFromUDFM or adjustUDFM when possible, they are
--- more efficient.
+-- more efficient. Updating an existing key keeps its position in the
+-- deterministic iteration order.
--
-- 'alterUDFM' is non-strict in @k@.
alterUDFM
@@ -447,16 +468,16 @@ alterUDFM
alterUDFM f (UDFM m i) k =
UDFM (M.alter alterf (getKey $ getUnique k) m) (i + 1)
where
- alterf Nothing = inject $ f Nothing
- alterf (Just (TaggedVal v _)) = inject $ f (Just v)
- inject Nothing = Nothing
- inject (Just v) = Just $ TaggedVal v i
+ alterf Nothing = inject i $ f Nothing
+ alterf (Just (TaggedVal v old_i)) = inject old_i $ f (Just v)
+ inject _ Nothing = Nothing
+ inject tag (Just v) = Just $ TaggedVal v tag
-- | The expression (@'upsertUDFM' f map k@) updates the value at @k@ or inserts
-- a new value if @k@ is absent.
--
--- Like 'alterUDFM', updating an existing entry assigns it the current tag, so it
--- becomes the newest element in deterministic iteration order.
+-- Updating an existing entry keeps its original tag, so its position in
+-- deterministic iteration order is unchanged and does not depend on update order.
upsertUDFM
:: Uniquable key
=> (Maybe elt -> elt) -- ^ How to adjust the element
@@ -467,13 +488,14 @@ upsertUDFM f (UDFM m i) k =
UDFM (MS.upsert upsertf (getKey $ getUnique k) m) (i + 1)
where
upsertf Nothing = TaggedVal (f Nothing) i
- upsertf (Just (TaggedVal v _)) = TaggedVal (f (Just v)) i
+ upsertf (Just (TaggedVal v old_i)) = TaggedVal (f (Just v)) old_i
-- | The expression (@'alterUDFM_L' f map k@) alters value @x@ at @k@, or absence
-- thereof and returns the new element at @k@ if there is any.
-- 'alterUDFM_L' can be used to insert, delete, or update a value in
-- UniqDFM. Use addToUDFM, delFromUDFM or adjustUDFM when possible, they are
--- more efficient.
+-- more efficient. Updating an existing key keeps its position in the
+-- deterministic iteration order.
--
-- Note, 'alterUDFM_L' is strict in @k@.
alterUDFM_L
@@ -489,10 +511,10 @@ alterUDFM_L f (UDFM m i) k =
(fmap taggedFst mElt, UDFM udfm (i + 1))
where
alterf :: Maybe (TaggedVal elt) -> (Maybe (TaggedVal elt))
- alterf Nothing = inject $ f Nothing
- alterf (Just (TaggedVal v _)) = inject $ f (Just v)
- inject Nothing = Nothing
- inject (Just v) = Just $ TaggedVal v i
+ alterf Nothing = inject i $ f Nothing
+ alterf (Just (TaggedVal v old_i)) = inject old_i $ f (Just v)
+ inject _ Nothing = Nothing
+ inject tag (Just v) = Just $ TaggedVal v tag
-- | Map a function over every value in a UniqDFM
mapUDFM :: (elt1 -> elt2) -> UniqDFM key elt1 -> UniqDFM key elt2
=====================================
testsuite/tests/ghci/T16793/T16793.stdout
=====================================
@@ -1,9 +1,9 @@
-instance Bounded Int -- Defined in ‘GHC.Internal.Enum’
+instance Eq Int -- Defined in ‘GHC.Internal.Classes’
+instance Ord Int -- Defined in ‘GHC.Internal.Classes’
instance Read Int -- Defined in ‘GHC.Internal.Read’
+instance Bounded Int -- Defined in ‘GHC.Internal.Enum’
instance Enum Int -- Defined in ‘GHC.Internal.Enum’
-instance Eq Int -- Defined in ‘GHC.Internal.Classes’
-instance Integral Int -- Defined in ‘GHC.Internal.Real’
instance Num Int -- Defined in ‘GHC.Internal.Num’
-instance Ord Int -- Defined in ‘GHC.Internal.Classes’
instance Real Int -- Defined in ‘GHC.Internal.Real’
instance Show Int -- Defined in ‘GHC.Internal.Show’
+instance Integral Int -- Defined in ‘GHC.Internal.Real’
=====================================
testsuite/tests/ghci/T18060/T18060.stdout
=====================================
@@ -2,13 +2,13 @@ type (->) :: * -> * -> *
type (->) = FUN Many
-- Defined in ‘GHC.Internal.Types’
infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
instance Monoid b => Monoid (a -> b)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup b => Semigroup (a -> b)
-- Defined in ‘GHC.Internal.Base’
-instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
type (~) :: forall k. k -> k -> Constraint
class (a ~ b) => (~) a b
-- Defined in ‘GHC.Internal.Types’
=====================================
testsuite/tests/ghci/T27532/Makefile
=====================================
@@ -0,0 +1,23 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+.PHONY: T27532
+T27532:
+ '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 < a.script 2>/dev/null | grep '^instance' > direct.txt
+ '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 < b.script 2>/dev/null | grep '^instance' > afterimport.txt
+ diff direct.txt afterimport.txt || true
+
+.PHONY: T27532j4
+T27532j4:
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_1.txt
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_2.txt
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_3.txt
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_4.txt
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_5.txt
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_6.txt
+ diff j4_1.txt j4_2.txt || true
+ diff j4_1.txt j4_3.txt || true
+ diff j4_1.txt j4_4.txt || true
+ diff j4_1.txt j4_5.txt || true
+ diff j4_1.txt j4_6.txt || true
=====================================
testsuite/tests/ghci/T27532/T27532.stdout
=====================================
=====================================
testsuite/tests/ghci/T27532/T27532j4.stdout
=====================================
=====================================
testsuite/tests/ghci/T27532/a.script
=====================================
@@ -0,0 +1 @@
+:info ()
=====================================
testsuite/tests/ghci/T27532/all.T
=====================================
@@ -0,0 +1,9 @@
+test('T27532',
+ [extra_files(['a.script', 'b.script'])],
+ makefile_test, ['T27532'])
+
+test('T27532j4',
+ [pre_cmd('./genT27532Modules'),
+ extra_files(['genT27532Modules']),
+ req_ghc_smp],
+ makefile_test, ['T27532j4'])
=====================================
testsuite/tests/ghci/T27532/b.script
=====================================
@@ -0,0 +1,3 @@
+import Data.Ratio
+_ <- return $! compare (1 % 2 :: Rational) (2 % 3)
+:info ()
=====================================
testsuite/tests/ghci/T27532/genT27532Modules
=====================================
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# Generate modules that each import and use a distinct instance-heavy module,
+# so a parallel :load races many interface loads against each other.
+gen() { f=$1; shift; printf '%s\n' "module ${f%.hs} where" "$@" > "$f"; }
+gen M01.hs "import Data.Ratio" "v :: Rational" "v = 1 % 2" "s = show v"
+gen M02.hs "import Data.Complex" "v :: Complex Double" "v = 1" "s = show v"
+gen M03.hs "import Data.Fixed" "v :: Fixed E2" "v = 1" "s = show v"
+gen M04.hs "import Foreign.C.Types" "v :: CInt" "v = 1" "s = show v" "b :: CInt" "b = maxBound"
+gen M05.hs "import System.Posix.Types" "v :: CPid" "v = 1" "s = show v"
+gen M06.hs "import Data.Version" "s = showVersion (makeVersion [1,2])"
+gen M07.hs "import Control.Exception" "s = show DivideByZero" "t = show StackOverflow"
+gen M08.hs "import Data.Dynamic" "s = show (toDyn ())"
+gen M09.hs "import Type.Reflection" "s = show (typeRep :: TypeRep Bool)"
+gen M10.hs "import Data.List.NonEmpty (NonEmpty(..))" "s = show (1 :| ([2,3] :: [Int]))"
+gen M11.hs "import Data.Ord" "s = show (Down (3 :: Int))" "c = compare (Down 1) (Down (2 :: Int))"
+gen M12.hs "import Data.Functor.Identity" "s = show (Identity (1 :: Int))"
+gen M13.hs "import Data.Functor.Const" "s = show (Const (1 :: Int) :: Const Int Bool)"
+gen M14.hs "import Data.Functor.Compose" "s = show (Compose (Just (Just (1 :: Int))))"
+gen M15.hs "import Data.Functor.Product" "s = show (Pair (Just (1 :: Int)) (Just (2 :: Int)))"
+gen M16.hs "import Data.Functor.Sum" "s = show (InL (Just (1 :: Int)) :: Sum Maybe Maybe Int)"
+gen M17.hs "import Data.Monoid" "s = show (Sum (1 :: Int) <> Sum 2)" "a = show (All True)"
+gen M18.hs "import Data.Semigroup" "s = show (Min (1 :: Int) <> Min 2)"
+gen M19.hs "import Text.Printf" "s = printf \"%d\" (1 :: Int) :: String"
+gen M20.hs "import Numeric.Natural" "s = show (5 :: Natural)" "v :: Natural" "v = 2 + 3"
+gen M21.hs "import Foreign.Ptr" "s = show nullPtr"
+gen M22.hs "import System.IO" "s = show stdout" "e = show stderr"
+gen M23.hs "import Data.IORef" "v :: IO (IORef Int)" "v = newIORef 1"
+gen M24.hs "import Data.Bits" "v = xor (1 :: Int) 2" "s = show v"
+for f in M??.hs; do
+ n=${f#M}; n=${n%.hs}
+ m=$(printf 'M%02d' $((10#$n + 24)))
+ sed "s/module M$n/module $m/" "$f" > "$m.hs"
+done
=====================================
testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
=====================================
@@ -1,13 +1,13 @@
type Unit :: *
data Unit = ()
-- Defined in ‘GHC.Internal.Tuple’
+instance Eq Unit -- Defined in ‘GHC.Internal.Classes’
instance Monoid Unit -- Defined in ‘GHC.Internal.Base’
+instance Ord Unit -- Defined in ‘GHC.Internal.Classes’
instance Semigroup Unit -- Defined in ‘GHC.Internal.Base’
-instance Bounded Unit -- Defined in ‘GHC.Internal.Enum’
instance Read Unit -- Defined in ‘GHC.Internal.Read’
+instance Bounded Unit -- Defined in ‘GHC.Internal.Enum’
instance Enum Unit -- Defined in ‘GHC.Internal.Enum’
-instance Eq Unit -- Defined in ‘GHC.Internal.Classes’
-instance Ord Unit -- Defined in ‘GHC.Internal.Classes’
instance Show Unit -- Defined in ‘GHC.Internal.Show’
type Unit# :: GHC.Internal.Types.ZeroBitType
data Unit# = (##)
@@ -15,23 +15,23 @@ data Unit# = (##)
type Solo :: * -> *
data Solo a = MkSolo a
-- Defined in ‘GHC.Internal.Tuple’
-instance Traversable Solo
- -- Defined in ‘GHC.Internal.Data.Traversable’
instance Applicative Solo -- Defined in ‘GHC.Internal.Base’
-instance Foldable Solo -- Defined in ‘GHC.Internal.Data.Foldable’
+instance Eq a => Eq (Solo a) -- Defined in ‘GHC.Internal.Classes’
instance Functor Solo -- Defined in ‘GHC.Internal.Base’
instance Monad Solo -- Defined in ‘GHC.Internal.Base’
+instance Monoid a => Monoid (Solo a)
+ -- Defined in ‘GHC.Internal.Base’
+instance Ord a => Ord (Solo a) -- Defined in ‘GHC.Internal.Classes’
+instance Semigroup a => Semigroup (Solo a)
+ -- Defined in ‘GHC.Internal.Base’
instance Read a => Read (Solo a) -- Defined in ‘GHC.Internal.Read’
instance Bounded a => Bounded (Solo a)
-- Defined in ‘GHC.Internal.Enum’
instance Enum a => Enum (Solo a) -- Defined in ‘GHC.Internal.Enum’
-instance Ord a => Ord (Solo a) -- Defined in ‘GHC.Internal.Classes’
instance Show a => Show (Solo a) -- Defined in ‘GHC.Internal.Show’
-instance Eq a => Eq (Solo a) -- Defined in ‘GHC.Internal.Classes’
-instance Monoid a => Monoid (Solo a)
- -- Defined in ‘GHC.Internal.Base’
-instance Semigroup a => Semigroup (Solo a)
- -- Defined in ‘GHC.Internal.Base’
+instance Foldable Solo -- Defined in ‘GHC.Internal.Data.Foldable’
+instance Traversable Solo
+ -- Defined in ‘GHC.Internal.Data.Traversable’
() :: Unit
(##) :: Unit#
( ) :: Unit
@@ -39,29 +39,29 @@ instance Semigroup a => Semigroup (Solo a)
type Tuple2 :: * -> * -> *
data Tuple2 a b = (,) a b
-- Defined in ‘GHC.Internal.Tuple’
-instance Traversable (Tuple2 a)
- -- Defined in ‘GHC.Internal.Data.Traversable’
instance Monoid a => Applicative (Tuple2 a)
-- Defined in ‘GHC.Internal.Base’
-instance Foldable (Tuple2 a)
- -- Defined in ‘GHC.Internal.Data.Foldable’
+instance (Eq a, Eq b) => Eq (Tuple2 a b)
+ -- Defined in ‘GHC.Internal.Classes’
instance Functor (Tuple2 a) -- Defined in ‘GHC.Internal.Base’
instance Monoid a => Monad (Tuple2 a)
-- Defined in ‘GHC.Internal.Base’
instance (Monoid a, Monoid b) => Monoid (Tuple2 a b)
-- Defined in ‘GHC.Internal.Base’
-instance (Semigroup a, Semigroup b) => Semigroup (Tuple2 a b)
- -- Defined in ‘GHC.Internal.Base’
-instance (Bounded a, Bounded b) => Bounded (Tuple2 a b)
- -- Defined in ‘GHC.Internal.Enum’
instance (Ord a, Ord b) => Ord (Tuple2 a b)
-- Defined in ‘GHC.Internal.Classes’
+instance (Semigroup a, Semigroup b) => Semigroup (Tuple2 a b)
+ -- Defined in ‘GHC.Internal.Base’
instance (Read a, Read b) => Read (Tuple2 a b)
-- Defined in ‘GHC.Internal.Read’
+instance (Bounded a, Bounded b) => Bounded (Tuple2 a b)
+ -- Defined in ‘GHC.Internal.Enum’
instance (Show a, Show b) => Show (Tuple2 a b)
-- Defined in ‘GHC.Internal.Show’
-instance (Eq a, Eq b) => Eq (Tuple2 a b)
- -- Defined in ‘GHC.Internal.Classes’
+instance Foldable (Tuple2 a)
+ -- Defined in ‘GHC.Internal.Data.Foldable’
+instance Traversable (Tuple2 a)
+ -- Defined in ‘GHC.Internal.Data.Traversable’
type Tuple2# :: *
-> *
-> TYPE
=====================================
testsuite/tests/ghci/scripts/T4175.stdout
=====================================
@@ -26,52 +26,52 @@ type Unit :: *
data Unit = ()
-- Defined in ‘GHC.Internal.Tuple’
instance [safe] C () -- Defined at T4175.hs:22:10
+instance Eq () -- Defined in ‘GHC.Internal.Classes’
instance Monoid () -- Defined in ‘GHC.Internal.Base’
+instance Ord () -- Defined in ‘GHC.Internal.Classes’
instance Semigroup () -- Defined in ‘GHC.Internal.Base’
+instance Read () -- Defined in ‘GHC.Internal.Read’
instance Bounded () -- Defined in ‘GHC.Internal.Enum’
instance Enum () -- Defined in ‘GHC.Internal.Enum’
-instance Ord () -- Defined in ‘GHC.Internal.Classes’
-instance Read () -- Defined in ‘GHC.Internal.Read’
instance Show () -- Defined in ‘GHC.Internal.Show’
-instance Eq () -- Defined in ‘GHC.Internal.Classes’
data instance B () = MkB -- Defined at T4175.hs:14:15
type instance D Int () = String -- Defined at T4175.hs:20:10
type instance D () () = Bool -- Defined at T4175.hs:23:10
type Maybe :: * -> *
data Maybe a = Nothing | Just a
-- Defined in ‘GHC.Internal.Maybe’
-instance Traversable Maybe
- -- Defined in ‘GHC.Internal.Data.Traversable’
-instance MonadFail Maybe
- -- Defined in ‘GHC.Internal.Control.Monad.Fail’
instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’
-instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
+instance [safe] Eq a => Eq (Maybe a)
+ -- Defined in ‘GHC.Internal.Maybe’
instance Functor Maybe -- Defined in ‘GHC.Internal.Base’
instance Monad Maybe -- Defined in ‘GHC.Internal.Base’
instance Semigroup a => Monoid (Maybe a)
-- Defined in ‘GHC.Internal.Base’
-instance Semigroup a => Semigroup (Maybe a)
- -- Defined in ‘GHC.Internal.Base’
instance [safe] Ord a => Ord (Maybe a)
-- Defined in ‘GHC.Internal.Maybe’
+instance Semigroup a => Semigroup (Maybe a)
+ -- Defined in ‘GHC.Internal.Base’
instance Read a => Read (Maybe a) -- Defined in ‘GHC.Internal.Read’
instance Show a => Show (Maybe a) -- Defined in ‘GHC.Internal.Show’
-instance [safe] Eq a => Eq (Maybe a)
- -- Defined in ‘GHC.Internal.Maybe’
+instance MonadFail Maybe
+ -- Defined in ‘GHC.Internal.Control.Monad.Fail’
+instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
+instance Traversable Maybe
+ -- Defined in ‘GHC.Internal.Data.Traversable’
type instance A (Maybe a) a = a -- Defined at T4175.hs:10:15
type Int :: *
data Int = GHC.Internal.Types.I# GHC.Internal.Prim.Int#
-- Defined in ‘GHC.Internal.Types’
instance [safe] C Int -- Defined at T4175.hs:19:10
+instance Eq Int -- Defined in ‘GHC.Internal.Classes’
+instance Ord Int -- Defined in ‘GHC.Internal.Classes’
+instance Read Int -- Defined in ‘GHC.Internal.Read’
instance Bounded Int -- Defined in ‘GHC.Internal.Enum’
instance Enum Int -- Defined in ‘GHC.Internal.Enum’
-instance Integral Int -- Defined in ‘GHC.Internal.Real’
instance Num Int -- Defined in ‘GHC.Internal.Num’
-instance Ord Int -- Defined in ‘GHC.Internal.Classes’
-instance Read Int -- Defined in ‘GHC.Internal.Read’
instance Real Int -- Defined in ‘GHC.Internal.Real’
instance Show Int -- Defined in ‘GHC.Internal.Show’
-instance Eq Int -- Defined in ‘GHC.Internal.Classes’
+instance Integral Int -- Defined in ‘GHC.Internal.Real’
type instance A Int Int = () -- Defined at T4175.hs:9:15
type instance D Int () = String -- Defined at T4175.hs:20:10
type Z :: * -> Constraint
=====================================
testsuite/tests/ghci/scripts/T8469.stdout
=====================================
@@ -1,12 +1,12 @@
type Int :: *
data Int = GHC.Internal.Types.I# GHC.Internal.Prim.Int#
-- Defined in ‘GHC.Internal.Types’
-instance Bounded Int -- Defined in ‘GHC.Internal.Enum’
+instance Eq Int -- Defined in ‘GHC.Internal.Classes’
+instance Ord Int -- Defined in ‘GHC.Internal.Classes’
instance Read Int -- Defined in ‘GHC.Internal.Read’
+instance Bounded Int -- Defined in ‘GHC.Internal.Enum’
instance Enum Int -- Defined in ‘GHC.Internal.Enum’
-instance Eq Int -- Defined in ‘GHC.Internal.Classes’
-instance Integral Int -- Defined in ‘GHC.Internal.Real’
instance Num Int -- Defined in ‘GHC.Internal.Num’
-instance Ord Int -- Defined in ‘GHC.Internal.Classes’
instance Real Int -- Defined in ‘GHC.Internal.Real’
instance Show Int -- Defined in ‘GHC.Internal.Show’
+instance Integral Int -- Defined in ‘GHC.Internal.Real’
=====================================
testsuite/tests/ghci/scripts/T8535.stdout
=====================================
@@ -2,10 +2,10 @@ type (->) :: * -> * -> *
type (->) = FUN Many
-- Defined in ‘GHC.Internal.Types’
infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
instance Monoid b => Monoid (a -> b)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup b => Semigroup (a -> b)
-- Defined in ‘GHC.Internal.Base’
-instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
=====================================
testsuite/tests/ghci/scripts/T9881.stdout
=====================================
@@ -4,16 +4,16 @@ data Data.ByteString.Lazy.ByteString
| Data.ByteString.Lazy.Internal.Chunk {-# UNPACK #-} !StrictByteString
Data.ByteString.Lazy.ByteString
-- Defined in ‘Data.ByteString.Lazy.Internal’
+instance Eq Data.ByteString.Lazy.ByteString
+ -- Defined in ‘Data.ByteString.Lazy.Internal’
instance Monoid Data.ByteString.Lazy.ByteString
-- Defined in ‘Data.ByteString.Lazy.Internal’
+instance Ord Data.ByteString.Lazy.ByteString
+ -- Defined in ‘Data.ByteString.Lazy.Internal’
instance Semigroup Data.ByteString.Lazy.ByteString
-- Defined in ‘Data.ByteString.Lazy.Internal’
instance Read Data.ByteString.Lazy.ByteString
-- Defined in ‘Data.ByteString.Lazy.Internal’
-instance Eq Data.ByteString.Lazy.ByteString
- -- Defined in ‘Data.ByteString.Lazy.Internal’
-instance Ord Data.ByteString.Lazy.ByteString
- -- Defined in ‘Data.ByteString.Lazy.Internal’
instance Show Data.ByteString.Lazy.ByteString
-- Defined in ‘Data.ByteString.Lazy.Internal’
@@ -23,15 +23,15 @@ data Data.ByteString.ByteString
GHC.Internal.Word.Word8)
{-# UNPACK #-} !Int
-- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
+instance Eq Data.ByteString.ByteString
+ -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
instance Monoid Data.ByteString.ByteString
-- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
+instance Ord Data.ByteString.ByteString
+ -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
instance Semigroup Data.ByteString.ByteString
-- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
instance Read Data.ByteString.ByteString
-- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
-instance Eq Data.ByteString.ByteString
- -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
-instance Ord Data.ByteString.ByteString
- -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
instance Show Data.ByteString.ByteString
-- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
=====================================
testsuite/tests/ghci/scripts/ghci020.stdout
=====================================
@@ -2,10 +2,10 @@ type (->) :: * -> * -> *
type (->) = FUN Many
-- Defined in ‘GHC.Internal.Types’
infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
instance Monoid b => Monoid (a -> b)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup b => Semigroup (a -> b)
-- Defined in ‘GHC.Internal.Base’
-instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
=====================================
testsuite/tests/ghci/scripts/ghci064.stdout
=====================================
@@ -1,52 +1,52 @@
-instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
-instance Traversable Maybe
- -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Base.Alternative Maybe
-- Defined in ‘GHC.Internal.Base’
instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’
instance Functor Maybe -- Defined in ‘GHC.Internal.Base’
-instance MonadFail Maybe
- -- Defined in ‘GHC.Internal.Control.Monad.Fail’
+instance Monad Maybe -- Defined in ‘GHC.Internal.Base’
instance GHC.Internal.Base.MonadPlus Maybe
-- Defined in ‘GHC.Internal.Base’
-instance Monad Maybe -- Defined in ‘GHC.Internal.Base’
+instance MonadFail Maybe
+ -- Defined in ‘GHC.Internal.Control.Monad.Fail’
+instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
+instance Traversable Maybe
+ -- Defined in ‘GHC.Internal.Data.Traversable’
+instance [safe] Eq w => Eq (Maybe w)
+ -- Defined in ‘GHC.Internal.Maybe’
instance Semigroup w => Monoid (Maybe w)
-- Defined in ‘GHC.Internal.Base’
-instance Read w => Read (Maybe w) -- Defined in ‘GHC.Internal.Read’
-instance Semigroup w => Semigroup (Maybe w)
- -- Defined in ‘GHC.Internal.Base’
instance [safe] Ord w => Ord (Maybe w)
-- Defined in ‘GHC.Internal.Maybe’
+instance Semigroup w => Semigroup (Maybe w)
+ -- Defined in ‘GHC.Internal.Base’
+instance Read w => Read (Maybe w) -- Defined in ‘GHC.Internal.Read’
instance Show w => Show (Maybe w) -- Defined in ‘GHC.Internal.Show’
-instance [safe] Eq w => Eq (Maybe w)
- -- Defined in ‘GHC.Internal.Maybe’
-instance Read w => Read [w] -- Defined in ‘GHC.Internal.Read’
-instance Ord w => Ord [w] -- Defined in ‘GHC.Internal.Classes’
-instance Show w => Show [w] -- Defined in ‘GHC.Internal.Show’
instance Eq w => Eq [w] -- Defined in ‘GHC.Internal.Classes’
instance Monoid [w] -- Defined in ‘GHC.Internal.Base’
+instance Ord w => Ord [w] -- Defined in ‘GHC.Internal.Classes’
instance Semigroup [w] -- Defined in ‘GHC.Internal.Base’
+instance Read w => Read [w] -- Defined in ‘GHC.Internal.Read’
+instance Show w => Show [w] -- Defined in ‘GHC.Internal.Show’
instance [safe] MyShow w => MyShow [w]
-- Defined at ghci064.hs:8:10
instance Monoid [T] -- Defined in ‘GHC.Internal.Base’
instance Semigroup [T] -- Defined in ‘GHC.Internal.Base’
instance [safe] MyShow [T] -- Defined at ghci064.hs:16:10
instance [safe] MyShow [T] -- Defined at ghci064.hs:8:10
-instance GHC.Internal.Foreign.Storable.Storable Bool
- -- Defined in ‘GHC.Internal.Foreign.Storable’
-instance GHC.Internal.Bits.Bits Bool
- -- Defined in ‘GHC.Internal.Bits’
+instance Eq Bool -- Defined in ‘GHC.Internal.Classes’
+instance Ord Bool -- Defined in ‘GHC.Internal.Classes’
+instance Read Bool -- Defined in ‘GHC.Internal.Read’
instance Bounded Bool -- Defined in ‘GHC.Internal.Enum’
instance Enum Bool -- Defined in ‘GHC.Internal.Enum’
+instance Show Bool -- Defined in ‘GHC.Internal.Show’
+instance GHC.Internal.Ix.Ix Bool -- Defined in ‘GHC.Internal.Ix’
+instance GHC.Internal.Bits.Bits Bool
+ -- Defined in ‘GHC.Internal.Bits’
instance GHC.Internal.Bits.FiniteBits Bool
-- Defined in ‘GHC.Internal.Bits’
-instance GHC.Internal.Ix.Ix Bool -- Defined in ‘GHC.Internal.Ix’
-instance Ord Bool -- Defined in ‘GHC.Internal.Classes’
-instance Read Bool -- Defined in ‘GHC.Internal.Read’
-instance Show Bool -- Defined in ‘GHC.Internal.Show’
-instance Eq Bool -- Defined in ‘GHC.Internal.Classes’
-instance Traversable ((,) Int)
- -- Defined in ‘GHC.Internal.Data.Traversable’
+instance GHC.Internal.Foreign.Storable.Storable Bool
+ -- Defined in ‘GHC.Internal.Foreign.Storable’
+instance Functor ((,) Int) -- Defined in ‘GHC.Internal.Base’
instance Foldable ((,) Int)
-- Defined in ‘GHC.Internal.Data.Foldable’
-instance Functor ((,) Int) -- Defined in ‘GHC.Internal.Base’
+instance Traversable ((,) Int)
+ -- Defined in ‘GHC.Internal.Data.Traversable’
=====================================
testsuite/tests/ghci/should_run/T10145.stdout
=====================================
@@ -2,10 +2,10 @@ type (->) :: * -> * -> *
type (->) = FUN Many
-- Defined in ‘GHC.Internal.Types’
infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
instance Monoid b => Monoid (a -> b)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup b => Semigroup (a -> b)
-- Defined in ‘GHC.Internal.Base’
-instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
=====================================
testsuite/tests/ghci/should_run/T18594.stdout
=====================================
@@ -2,13 +2,13 @@ type (->) :: * -> * -> *
type (->) = FUN Many
-- Defined in ‘GHC.Internal.Types’
infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
instance Monoid b => Monoid (a -> b)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup b => Semigroup (a -> b)
-- Defined in ‘GHC.Internal.Base’
-instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
type Constraint :: *
type Constraint = CONSTRAINT LiftedRep
-- Defined in ‘GHC.Internal.Types’
=====================================
testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
=====================================
@@ -21,7 +21,7 @@ TYPE SIGNATURES
(>>) :: forall {m :: * -> *} {a} {b}. Monad m => m a -> m b -> m b
(>>=) ::
forall {m :: * -> *} {a} {b}. Monad m => m a -> (a -> m b) -> m b
- (^) :: forall {b} {a}. (Integral b, Num a) => a -> b -> a
+ (^) :: forall {a} {b}. (Num a, Integral b) => a -> b -> a
(^^) :: forall {a} {b}. (Fractional a, Integral b) => a -> b -> a
abs :: forall {a}. Num a => a -> a
acos :: forall {a}. Floating a => a -> a
@@ -236,4 +236,4 @@ TYPE SIGNATURES
(a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
(||) :: Bool -> Bool -> Bool
Dependent modules: []
-Dependent packages: [(normal, base-4.21.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
=====================================
testsuite/tests/roles/should_compile/Roles14.stderr
=====================================
@@ -4,7 +4,7 @@ TYPE CONSTRUCTORS
class C2{1} :: * -> Constraint
roles representational
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
Roles12.$tcC2 [InlPrag=[~]]
@@ -15,14 +15,14 @@ Roles12.$tc'C:C2 [InlPrag=[~]]
= GHC.Internal.Types.TyCon
7087988437584478859#Word64 11477953550142401435#Word64
Roles12.$trModule (GHC.Internal.Types.TrNameS "'C:C2"#) 1# $krep
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp Roles12.$tcC2 ((:) $krep [])
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepFun
GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp Roles12.$tcC2 ((:) $krep [])
Roles12.$trModule [InlPrag=[~]]
= GHC.Internal.Types.Module
(GHC.Internal.Types.TrNameS "main"#)
=====================================
testsuite/tests/roles/should_compile/Roles3.stderr
=====================================
@@ -16,7 +16,7 @@ TYPE CONSTRUCTORS
roles nominal
type synonym Syn2{1} :: * -> *
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
Roles3.$tcC4 [InlPrag=[~]]
@@ -43,15 +43,6 @@ Roles3.$tc'C:C1 [InlPrag=[~]]
= GHC.Internal.Types.TyCon
4508088879886988796#Word64 13962145553903222779#Word64
Roles3.$trModule (GHC.Internal.Types.TrNameS "'C:C1"#) 1# $krep
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp
- GHC.Internal.Types.$tc~
- ((:) GHC.Internal.Types.krep$* ((:) $krep ((:) $krep [])))
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp
- Roles3.$tcC2 ((:) $krep ((:) $krep []))
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp Roles3.$tcC1 ((:) $krep [])
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
@@ -64,6 +55,15 @@ $krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepFun
GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp
+ GHC.Internal.Types.$tc~
+ ((:) GHC.Internal.Types.krep$* ((:) $krep ((:) $krep [])))
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp
+ Roles3.$tcC2 ((:) $krep ((:) $krep []))
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp Roles3.$tcC1 ((:) $krep [])
Roles3.$trModule [InlPrag=[~]]
= GHC.Internal.Types.Module
(GHC.Internal.Types.TrNameS "main"#)
=====================================
testsuite/tests/roles/should_compile/Roles4.stderr
=====================================
@@ -6,7 +6,7 @@ TYPE CONSTRUCTORS
class C3{1} :: * -> Constraint
type synonym Syn1{1} :: * -> *
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
Roles4.$tcC3 [InlPrag=[~]]
@@ -25,10 +25,6 @@ Roles4.$tc'C:C1 [InlPrag=[~]]
= GHC.Internal.Types.TyCon
3870707671502302648#Word64 10631907186261837450#Word64
Roles4.$trModule (GHC.Internal.Types.TrNameS "'C:C1"#) 1# $krep
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC3 ((:) $krep [])
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC1 ((:) $krep [])
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
@@ -40,6 +36,10 @@ $krep [InlPrag=[~]]
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepTyConApp
GHC.Internal.Types.$tcList ((:) $krep [])
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC3 ((:) $krep [])
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC1 ((:) $krep [])
Roles4.$trModule [InlPrag=[~]]
= GHC.Internal.Types.Module
(GHC.Internal.Types.TrNameS "main"#)
=====================================
testsuite/tests/roles/should_compile/T8958.stderr
=====================================
@@ -18,7 +18,7 @@ CLASS INSTANCES
instance [incoherent] Representational a
-- Defined at T8958.hs:11:10
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
T8958.$tcMap [InlPrag=[~]]
@@ -50,10 +50,10 @@ T8958.$tc'C:Nominal [InlPrag=[~]]
T8958.$trModule (GHC.Internal.Types.TrNameS "'C:Nominal"#) 1# $krep
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1
-$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepFun
GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint
+$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepTyConApp
GHC.Internal.Tuple.$tcTuple2
=====================================
testsuite/tests/typecheck/should_compile/T18406b.stderr
=====================================
@@ -4,7 +4,7 @@ TYPE SIGNATURES
TYPE CONSTRUCTORS
class C{2} :: * -> * -> Constraint
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
Bug.$tcC [InlPrag=[~]]
@@ -15,13 +15,6 @@ Bug.$tc'C:C [InlPrag=[~]]
= GHC.Internal.Types.TyCon
302756782745842909#Word64 14248103394115774781#Word64 Bug.$trModule
(GHC.Internal.Types.TrNameS "'C:C"#) 2# $krep
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp
- Bug.$tcC
- ((:) @GHC.Internal.Types.KindRep
- $krep
- ((:) @GHC.Internal.Types.KindRep
- $krep [] @GHC.Internal.Types.KindRep))
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
@@ -31,6 +24,13 @@ $krep [InlPrag=[~]]
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepFun
GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp
+ Bug.$tcC
+ ((:) @GHC.Internal.Types.KindRep
+ $krep
+ ((:) @GHC.Internal.Types.KindRep
+ $krep [] @GHC.Internal.Types.KindRep))
Bug.$trModule [InlPrag=[~]]
= GHC.Internal.Types.Module
(GHC.Internal.Types.TrNameS "main"#)
=====================================
testsuite/tests/typecheck/should_compile/T18529.stderr
=====================================
@@ -4,7 +4,7 @@ TYPE SIGNATURES
TYPE CONSTRUCTORS
class C{2} :: * -> * -> Constraint
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
Bug.$tcC [InlPrag=[~]]
@@ -15,13 +15,6 @@ Bug.$tc'C:C [InlPrag=[~]]
= GHC.Internal.Types.TyCon
302756782745842909#Word64 14248103394115774781#Word64 Bug.$trModule
(GHC.Internal.Types.TrNameS "'C:C"#) 2# $krep
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp
- Bug.$tcC
- ((:) @GHC.Internal.Types.KindRep
- $krep
- ((:) @GHC.Internal.Types.KindRep
- $krep [] @GHC.Internal.Types.KindRep))
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
@@ -35,6 +28,13 @@ $krep [InlPrag=[~]]
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepTyConApp
GHC.Internal.Tuple.$tcUnit [] @GHC.Internal.Types.KindRep
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp
+ Bug.$tcC
+ ((:) @GHC.Internal.Types.KindRep
+ $krep
+ ((:) @GHC.Internal.Types.KindRep
+ $krep [] @GHC.Internal.Types.KindRep))
Bug.$trModule [InlPrag=[~]]
= GHC.Internal.Types.Module
(GHC.Internal.Types.TrNameS "main"#)
=====================================
testsuite/tests/typecheck/should_fail/T5300.stderr
=====================================
@@ -1,4 +1,3 @@
-
T5300.hs:12:7: error: [GHC-39999]
• Could not deduce ‘C1 a b c0’
from the context: (Monad m, C1 a b c)
@@ -14,16 +13,17 @@ T5300.hs:12:7: error: [GHC-39999]
f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a
T5300.hs:15:7: error: [GHC-39999]
- • Could not deduce ‘C1 a1 b1 c10’
+ • Could not deduce ‘C2 a2 b2 c20’
from the context: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2)
bound by the type signature for:
f2 :: forall (m :: * -> *) a1 b1 c1 a2 b2 c2.
(Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
a1 -> StateT (T b2) m a2
at T5300.hs:15:7-69
- The type variable ‘c10’ is ambiguous
+ The type variable ‘c20’ is ambiguous
• In the ambiguity check for ‘f2’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature:
f2 :: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
a1 -> StateT (T b2) m a2
+
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/498f505726801671d93d49125d2dbce…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/498f505726801671d93d49125d2dbce…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/27532] UniqueDFM: alter should preserve insertion order
by Zubin (@wz1000) 22 Jul '26
by Zubin (@wz1000) 22 Jul '26
22 Jul '26
Zubin pushed to branch wip/27532 at Glasgow Haskell Compiler / GHC
Commits:
ca869395 by Zubin Duggal at 2026-07-22T18:03:58+05:30
UniqueDFM: alter should preserve insertion order
Before it always inserting new elements at the end.
This is problematic because instances get inserted into the map with
`alterF`, which can change ordering of how instances are printed
with `:info` depending on the order in which we consult interfaces
I expect `alter id k = id` and `alter (fmap f) k = adjust f k`. Moving keys to
the end breaks that (`adjust` already preserves position).
Fixes #27532
- - - - -
27 changed files:
- compiler/GHC/Types/Unique/DFM.hs
- testsuite/tests/ghci/T16793/T16793.stdout
- testsuite/tests/ghci/T18060/T18060.stdout
- + testsuite/tests/ghci/T27532/Makefile
- + testsuite/tests/ghci/T27532/T27532.stdout
- + testsuite/tests/ghci/T27532/T27532j4.stdout
- + testsuite/tests/ghci/T27532/a.script
- + testsuite/tests/ghci/T27532/all.T
- + testsuite/tests/ghci/T27532/b.script
- + testsuite/tests/ghci/T27532/genT27532Modules
- testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
- testsuite/tests/ghci/scripts/T4175.stdout
- testsuite/tests/ghci/scripts/T8469.stdout
- testsuite/tests/ghci/scripts/T8535.stdout
- testsuite/tests/ghci/scripts/T9881.stdout
- testsuite/tests/ghci/scripts/ghci020.stdout
- testsuite/tests/ghci/scripts/ghci064.stdout
- testsuite/tests/ghci/should_run/T10145.stdout
- testsuite/tests/ghci/should_run/T18594.stdout
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
- testsuite/tests/roles/should_compile/Roles14.stderr
- testsuite/tests/roles/should_compile/Roles3.stderr
- testsuite/tests/roles/should_compile/Roles4.stderr
- testsuite/tests/roles/should_compile/T8958.stderr
- testsuite/tests/typecheck/should_compile/T18406b.stderr
- testsuite/tests/typecheck/should_compile/T18529.stderr
- testsuite/tests/typecheck/should_fail/T5300.stderr
Changes:
=====================================
compiler/GHC/Types/Unique/DFM.hs
=====================================
@@ -91,6 +91,23 @@ import qualified GHC.Data.Word64Set as W
-- If the client of the map performs operations on the map in deterministic
-- order then `udfmToList` returns them in deterministic order.
--
+-- More precisely, the order is insertion order. A key takes its position
+-- when it is added to the map after being absent. Operations that modify
+-- the value at an existing key (addToUDFM, adjustUDFM, alterUDFM, ...) do
+-- not move it. Deleting a key and adding it back moves it to the end.
+--
+-- In particular the order does not depend on how existing entries were
+-- updated. This makes alterUDFM consistent with addToUDFM and adjustUDFM,
+-- so that for example alterUDFM id k = id.
+--
+-- It also keeps the order stable for maps whose entries are updated many
+-- times. The instance environments are the main example: inserting an
+-- instance updates the entry of its class in a DNameEnv, and when updates
+-- moved keys to the end the order of instances shown by :info depended on
+-- the order in which interfaces happened to be loaded (#27532). Now a
+-- class keeps its place once its first instance is added, so loading
+-- further interfaces cannot change the order.
+--
-- There is an implementation cost: each element is given a serial number
-- as it is added, and `udfmToList` sorts its result by this serial
-- number. So you should only use `UniqDFM` if you need the deterministic
@@ -108,7 +125,8 @@ import qualified GHC.Data.Word64Set as W
--
-- There's more than one way to implement this. The implementation here tags
-- every value with the insertion time that can later be used to sort the
--- values when asked to convert to a list.
+-- values when asked to convert to a list. Updating an existing key keeps
+-- the old tag.
--
-- An alternative would be to have
--
@@ -169,11 +187,13 @@ emptyUDFM = UDFM M.empty 0
unitUDFM :: Uniquable key => key -> elt -> UniqDFM key elt
unitUDFM k v = UDFM (M.singleton (getKey $ getUnique k) (TaggedVal v 0)) 1
--- The new binding always goes to the right of existing ones
+-- A new key goes to the right of existing ones
+-- Overwriting an existing key keeps its position in the iteration order
addToUDFM :: Uniquable key => UniqDFM key elt -> key -> elt -> UniqDFM key elt
addToUDFM m k v = addToUDFM_Directly m (getUnique k) v
--- The new binding always goes to the right of existing ones
+-- A new key goes to the right of existing ones
+-- Overwriting an existing key keeps its position in the iteration order
addToUDFM_Directly :: UniqDFM key elt -> Unique -> elt -> UniqDFM key elt
addToUDFM_Directly (UDFM m i) u v
= UDFM (MS.insertWith tf (getKey u) (TaggedVal v i) m) (i + 1)
@@ -435,7 +455,8 @@ adjustUDFM_Directly f (UDFM m i) k = UDFM (M.adjust (fmap f) (getKey k) m) i
-- | The expression (@'alterUDFM' f map k@) alters value x at k, or absence
-- thereof. 'alterUDFM' can be used to insert, delete, or update a value in
-- UniqDFM. Use addToUDFM, delFromUDFM or adjustUDFM when possible, they are
--- more efficient.
+-- more efficient. Updating an existing key keeps its position in the
+-- deterministic iteration order.
--
-- 'alterUDFM' is non-strict in @k@.
alterUDFM
@@ -447,16 +468,16 @@ alterUDFM
alterUDFM f (UDFM m i) k =
UDFM (M.alter alterf (getKey $ getUnique k) m) (i + 1)
where
- alterf Nothing = inject $ f Nothing
- alterf (Just (TaggedVal v _)) = inject $ f (Just v)
- inject Nothing = Nothing
- inject (Just v) = Just $ TaggedVal v i
+ alterf Nothing = inject i $ f Nothing
+ alterf (Just (TaggedVal v old_i)) = inject old_i $ f (Just v)
+ inject _ Nothing = Nothing
+ inject tag (Just v) = Just $ TaggedVal v tag
-- | The expression (@'upsertUDFM' f map k@) updates the value at @k@ or inserts
-- a new value if @k@ is absent.
--
--- Like 'alterUDFM', updating an existing entry assigns it the current tag, so it
--- becomes the newest element in deterministic iteration order.
+-- Updating an existing entry keeps its original tag, so its position in
+-- deterministic iteration order is unchanged and does not depend on update order.
upsertUDFM
:: Uniquable key
=> (Maybe elt -> elt) -- ^ How to adjust the element
@@ -467,13 +488,14 @@ upsertUDFM f (UDFM m i) k =
UDFM (MS.upsert upsertf (getKey $ getUnique k) m) (i + 1)
where
upsertf Nothing = TaggedVal (f Nothing) i
- upsertf (Just (TaggedVal v _)) = TaggedVal (f (Just v)) i
+ upsertf (Just (TaggedVal v old_i)) = TaggedVal (f (Just v)) old_i
-- | The expression (@'alterUDFM_L' f map k@) alters value @x@ at @k@, or absence
-- thereof and returns the new element at @k@ if there is any.
-- 'alterUDFM_L' can be used to insert, delete, or update a value in
-- UniqDFM. Use addToUDFM, delFromUDFM or adjustUDFM when possible, they are
--- more efficient.
+-- more efficient. Updating an existing key keeps its position in the
+-- deterministic iteration order.
--
-- Note, 'alterUDFM_L' is strict in @k@.
alterUDFM_L
@@ -489,10 +511,10 @@ alterUDFM_L f (UDFM m i) k =
(fmap taggedFst mElt, UDFM udfm (i + 1))
where
alterf :: Maybe (TaggedVal elt) -> (Maybe (TaggedVal elt))
- alterf Nothing = inject $ f Nothing
- alterf (Just (TaggedVal v _)) = inject $ f (Just v)
- inject Nothing = Nothing
- inject (Just v) = Just $ TaggedVal v i
+ alterf Nothing = inject i $ f Nothing
+ alterf (Just (TaggedVal v old_i)) = inject old_i $ f (Just v)
+ inject _ Nothing = Nothing
+ inject tag (Just v) = Just $ TaggedVal v tag
-- | Map a function over every value in a UniqDFM
mapUDFM :: (elt1 -> elt2) -> UniqDFM key elt1 -> UniqDFM key elt2
=====================================
testsuite/tests/ghci/T16793/T16793.stdout
=====================================
@@ -1,9 +1,9 @@
-instance Bounded Int -- Defined in ‘GHC.Internal.Enum’
+instance Eq Int -- Defined in ‘GHC.Internal.Classes’
+instance Ord Int -- Defined in ‘GHC.Internal.Classes’
instance Read Int -- Defined in ‘GHC.Internal.Read’
+instance Bounded Int -- Defined in ‘GHC.Internal.Enum’
instance Enum Int -- Defined in ‘GHC.Internal.Enum’
-instance Eq Int -- Defined in ‘GHC.Internal.Classes’
-instance Integral Int -- Defined in ‘GHC.Internal.Real’
instance Num Int -- Defined in ‘GHC.Internal.Num’
-instance Ord Int -- Defined in ‘GHC.Internal.Classes’
instance Real Int -- Defined in ‘GHC.Internal.Real’
instance Show Int -- Defined in ‘GHC.Internal.Show’
+instance Integral Int -- Defined in ‘GHC.Internal.Real’
=====================================
testsuite/tests/ghci/T18060/T18060.stdout
=====================================
@@ -2,13 +2,13 @@ type (->) :: * -> * -> *
type (->) = FUN Many
-- Defined in ‘GHC.Internal.Types’
infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
instance Monoid b => Monoid (a -> b)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup b => Semigroup (a -> b)
-- Defined in ‘GHC.Internal.Base’
-instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
type (~) :: forall k. k -> k -> Constraint
class (a ~ b) => (~) a b
-- Defined in ‘GHC.Internal.Types’
=====================================
testsuite/tests/ghci/T27532/Makefile
=====================================
@@ -0,0 +1,23 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+.PHONY: T27532
+T27532:
+ '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 < a.script 2>/dev/null | grep '^instance' > direct.txt
+ '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 < b.script 2>/dev/null | grep '^instance' > afterimport.txt
+ diff direct.txt afterimport.txt || true
+
+.PHONY: T27532j4
+T27532j4:
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_1.txt
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_2.txt
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_3.txt
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_4.txt
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_5.txt
+ printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_6.txt
+ diff j4_1.txt j4_2.txt || true
+ diff j4_1.txt j4_3.txt || true
+ diff j4_1.txt j4_4.txt || true
+ diff j4_1.txt j4_5.txt || true
+ diff j4_1.txt j4_6.txt || true
=====================================
testsuite/tests/ghci/T27532/T27532.stdout
=====================================
=====================================
testsuite/tests/ghci/T27532/T27532j4.stdout
=====================================
=====================================
testsuite/tests/ghci/T27532/a.script
=====================================
@@ -0,0 +1 @@
+:info ()
=====================================
testsuite/tests/ghci/T27532/all.T
=====================================
@@ -0,0 +1,9 @@
+test('T27532',
+ [extra_files(['a.script', 'b.script'])],
+ makefile_test, ['T27532'])
+
+test('T27532j4',
+ [pre_cmd('./genT27532Modules'),
+ extra_files(['genT27532Modules']),
+ req_ghc_smp],
+ makefile_test, ['T27532j4'])
=====================================
testsuite/tests/ghci/T27532/b.script
=====================================
@@ -0,0 +1,3 @@
+import Data.Ratio
+_ <- return $! compare (1 % 2 :: Rational) (2 % 3)
+:info ()
=====================================
testsuite/tests/ghci/T27532/genT27532Modules
=====================================
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# Generate modules that each import and use a distinct instance-heavy module,
+# so a parallel :load races many interface loads against each other.
+gen() { f=$1; shift; printf '%s\n' "module ${f%.hs} where" "$@" > "$f"; }
+gen M01.hs "import Data.Ratio" "v :: Rational" "v = 1 % 2" "s = show v"
+gen M02.hs "import Data.Complex" "v :: Complex Double" "v = 1" "s = show v"
+gen M03.hs "import Data.Fixed" "v :: Fixed E2" "v = 1" "s = show v"
+gen M04.hs "import Foreign.C.Types" "v :: CInt" "v = 1" "s = show v" "b :: CInt" "b = maxBound"
+gen M05.hs "import System.Posix.Types" "v :: CPid" "v = 1" "s = show v"
+gen M06.hs "import Data.Version" "s = showVersion (makeVersion [1,2])"
+gen M07.hs "import Control.Exception" "s = show DivideByZero" "t = show StackOverflow"
+gen M08.hs "import Data.Dynamic" "s = show (toDyn ())"
+gen M09.hs "import Type.Reflection" "s = show (typeRep :: TypeRep Bool)"
+gen M10.hs "import Data.List.NonEmpty (NonEmpty(..))" "s = show (1 :| ([2,3] :: [Int]))"
+gen M11.hs "import Data.Ord" "s = show (Down (3 :: Int))" "c = compare (Down 1) (Down (2 :: Int))"
+gen M12.hs "import Data.Functor.Identity" "s = show (Identity (1 :: Int))"
+gen M13.hs "import Data.Functor.Const" "s = show (Const (1 :: Int) :: Const Int Bool)"
+gen M14.hs "import Data.Functor.Compose" "s = show (Compose (Just (Just (1 :: Int))))"
+gen M15.hs "import Data.Functor.Product" "s = show (Pair (Just (1 :: Int)) (Just (2 :: Int)))"
+gen M16.hs "import Data.Functor.Sum" "s = show (InL (Just (1 :: Int)) :: Sum Maybe Maybe Int)"
+gen M17.hs "import Data.Monoid" "s = show (Sum (1 :: Int) <> Sum 2)" "a = show (All True)"
+gen M18.hs "import Data.Semigroup" "s = show (Min (1 :: Int) <> Min 2)"
+gen M19.hs "import Text.Printf" "s = printf \"%d\" (1 :: Int) :: String"
+gen M20.hs "import Numeric.Natural" "s = show (5 :: Natural)" "v :: Natural" "v = 2 + 3"
+gen M21.hs "import Foreign.Ptr" "s = show nullPtr"
+gen M22.hs "import System.IO" "s = show stdout" "e = show stderr"
+gen M23.hs "import Data.IORef" "v :: IO (IORef Int)" "v = newIORef 1"
+gen M24.hs "import Data.Bits" "v = xor (1 :: Int) 2" "s = show v"
+for f in M??.hs; do
+ n=${f#M}; n=${n%.hs}
+ m=$(printf 'M%02d' $((10#$n + 24)))
+ sed "s/module M$n/module $m/" "$f" > "$m.hs"
+done
=====================================
testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
=====================================
@@ -1,13 +1,13 @@
type Unit :: *
data Unit = ()
-- Defined in ‘GHC.Internal.Tuple’
+instance Eq Unit -- Defined in ‘GHC.Internal.Classes’
instance Monoid Unit -- Defined in ‘GHC.Internal.Base’
+instance Ord Unit -- Defined in ‘GHC.Internal.Classes’
instance Semigroup Unit -- Defined in ‘GHC.Internal.Base’
-instance Bounded Unit -- Defined in ‘GHC.Internal.Enum’
instance Read Unit -- Defined in ‘GHC.Internal.Read’
+instance Bounded Unit -- Defined in ‘GHC.Internal.Enum’
instance Enum Unit -- Defined in ‘GHC.Internal.Enum’
-instance Eq Unit -- Defined in ‘GHC.Internal.Classes’
-instance Ord Unit -- Defined in ‘GHC.Internal.Classes’
instance Show Unit -- Defined in ‘GHC.Internal.Show’
type Unit# :: GHC.Internal.Types.ZeroBitType
data Unit# = (##)
@@ -15,23 +15,23 @@ data Unit# = (##)
type Solo :: * -> *
data Solo a = MkSolo a
-- Defined in ‘GHC.Internal.Tuple’
-instance Traversable Solo
- -- Defined in ‘GHC.Internal.Data.Traversable’
instance Applicative Solo -- Defined in ‘GHC.Internal.Base’
-instance Foldable Solo -- Defined in ‘GHC.Internal.Data.Foldable’
+instance Eq a => Eq (Solo a) -- Defined in ‘GHC.Internal.Classes’
instance Functor Solo -- Defined in ‘GHC.Internal.Base’
instance Monad Solo -- Defined in ‘GHC.Internal.Base’
+instance Monoid a => Monoid (Solo a)
+ -- Defined in ‘GHC.Internal.Base’
+instance Ord a => Ord (Solo a) -- Defined in ‘GHC.Internal.Classes’
+instance Semigroup a => Semigroup (Solo a)
+ -- Defined in ‘GHC.Internal.Base’
instance Read a => Read (Solo a) -- Defined in ‘GHC.Internal.Read’
instance Bounded a => Bounded (Solo a)
-- Defined in ‘GHC.Internal.Enum’
instance Enum a => Enum (Solo a) -- Defined in ‘GHC.Internal.Enum’
-instance Ord a => Ord (Solo a) -- Defined in ‘GHC.Internal.Classes’
instance Show a => Show (Solo a) -- Defined in ‘GHC.Internal.Show’
-instance Eq a => Eq (Solo a) -- Defined in ‘GHC.Internal.Classes’
-instance Monoid a => Monoid (Solo a)
- -- Defined in ‘GHC.Internal.Base’
-instance Semigroup a => Semigroup (Solo a)
- -- Defined in ‘GHC.Internal.Base’
+instance Foldable Solo -- Defined in ‘GHC.Internal.Data.Foldable’
+instance Traversable Solo
+ -- Defined in ‘GHC.Internal.Data.Traversable’
() :: Unit
(##) :: Unit#
( ) :: Unit
@@ -39,29 +39,29 @@ instance Semigroup a => Semigroup (Solo a)
type Tuple2 :: * -> * -> *
data Tuple2 a b = (,) a b
-- Defined in ‘GHC.Internal.Tuple’
-instance Traversable (Tuple2 a)
- -- Defined in ‘GHC.Internal.Data.Traversable’
instance Monoid a => Applicative (Tuple2 a)
-- Defined in ‘GHC.Internal.Base’
-instance Foldable (Tuple2 a)
- -- Defined in ‘GHC.Internal.Data.Foldable’
+instance (Eq a, Eq b) => Eq (Tuple2 a b)
+ -- Defined in ‘GHC.Internal.Classes’
instance Functor (Tuple2 a) -- Defined in ‘GHC.Internal.Base’
instance Monoid a => Monad (Tuple2 a)
-- Defined in ‘GHC.Internal.Base’
instance (Monoid a, Monoid b) => Monoid (Tuple2 a b)
-- Defined in ‘GHC.Internal.Base’
-instance (Semigroup a, Semigroup b) => Semigroup (Tuple2 a b)
- -- Defined in ‘GHC.Internal.Base’
-instance (Bounded a, Bounded b) => Bounded (Tuple2 a b)
- -- Defined in ‘GHC.Internal.Enum’
instance (Ord a, Ord b) => Ord (Tuple2 a b)
-- Defined in ‘GHC.Internal.Classes’
+instance (Semigroup a, Semigroup b) => Semigroup (Tuple2 a b)
+ -- Defined in ‘GHC.Internal.Base’
instance (Read a, Read b) => Read (Tuple2 a b)
-- Defined in ‘GHC.Internal.Read’
+instance (Bounded a, Bounded b) => Bounded (Tuple2 a b)
+ -- Defined in ‘GHC.Internal.Enum’
instance (Show a, Show b) => Show (Tuple2 a b)
-- Defined in ‘GHC.Internal.Show’
-instance (Eq a, Eq b) => Eq (Tuple2 a b)
- -- Defined in ‘GHC.Internal.Classes’
+instance Foldable (Tuple2 a)
+ -- Defined in ‘GHC.Internal.Data.Foldable’
+instance Traversable (Tuple2 a)
+ -- Defined in ‘GHC.Internal.Data.Traversable’
type Tuple2# :: *
-> *
-> TYPE
=====================================
testsuite/tests/ghci/scripts/T4175.stdout
=====================================
@@ -26,52 +26,52 @@ type Unit :: *
data Unit = ()
-- Defined in ‘GHC.Internal.Tuple’
instance [safe] C () -- Defined at T4175.hs:22:10
+instance Eq () -- Defined in ‘GHC.Internal.Classes’
instance Monoid () -- Defined in ‘GHC.Internal.Base’
+instance Ord () -- Defined in ‘GHC.Internal.Classes’
instance Semigroup () -- Defined in ‘GHC.Internal.Base’
+instance Read () -- Defined in ‘GHC.Internal.Read’
instance Bounded () -- Defined in ‘GHC.Internal.Enum’
instance Enum () -- Defined in ‘GHC.Internal.Enum’
-instance Ord () -- Defined in ‘GHC.Internal.Classes’
-instance Read () -- Defined in ‘GHC.Internal.Read’
instance Show () -- Defined in ‘GHC.Internal.Show’
-instance Eq () -- Defined in ‘GHC.Internal.Classes’
data instance B () = MkB -- Defined at T4175.hs:14:15
type instance D Int () = String -- Defined at T4175.hs:20:10
type instance D () () = Bool -- Defined at T4175.hs:23:10
type Maybe :: * -> *
data Maybe a = Nothing | Just a
-- Defined in ‘GHC.Internal.Maybe’
-instance Traversable Maybe
- -- Defined in ‘GHC.Internal.Data.Traversable’
-instance MonadFail Maybe
- -- Defined in ‘GHC.Internal.Control.Monad.Fail’
instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’
-instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
+instance [safe] Eq a => Eq (Maybe a)
+ -- Defined in ‘GHC.Internal.Maybe’
instance Functor Maybe -- Defined in ‘GHC.Internal.Base’
instance Monad Maybe -- Defined in ‘GHC.Internal.Base’
instance Semigroup a => Monoid (Maybe a)
-- Defined in ‘GHC.Internal.Base’
-instance Semigroup a => Semigroup (Maybe a)
- -- Defined in ‘GHC.Internal.Base’
instance [safe] Ord a => Ord (Maybe a)
-- Defined in ‘GHC.Internal.Maybe’
+instance Semigroup a => Semigroup (Maybe a)
+ -- Defined in ‘GHC.Internal.Base’
instance Read a => Read (Maybe a) -- Defined in ‘GHC.Internal.Read’
instance Show a => Show (Maybe a) -- Defined in ‘GHC.Internal.Show’
-instance [safe] Eq a => Eq (Maybe a)
- -- Defined in ‘GHC.Internal.Maybe’
+instance MonadFail Maybe
+ -- Defined in ‘GHC.Internal.Control.Monad.Fail’
+instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
+instance Traversable Maybe
+ -- Defined in ‘GHC.Internal.Data.Traversable’
type instance A (Maybe a) a = a -- Defined at T4175.hs:10:15
type Int :: *
data Int = GHC.Internal.Types.I# GHC.Internal.Prim.Int#
-- Defined in ‘GHC.Internal.Types’
instance [safe] C Int -- Defined at T4175.hs:19:10
+instance Eq Int -- Defined in ‘GHC.Internal.Classes’
+instance Ord Int -- Defined in ‘GHC.Internal.Classes’
+instance Read Int -- Defined in ‘GHC.Internal.Read’
instance Bounded Int -- Defined in ‘GHC.Internal.Enum’
instance Enum Int -- Defined in ‘GHC.Internal.Enum’
-instance Integral Int -- Defined in ‘GHC.Internal.Real’
instance Num Int -- Defined in ‘GHC.Internal.Num’
-instance Ord Int -- Defined in ‘GHC.Internal.Classes’
-instance Read Int -- Defined in ‘GHC.Internal.Read’
instance Real Int -- Defined in ‘GHC.Internal.Real’
instance Show Int -- Defined in ‘GHC.Internal.Show’
-instance Eq Int -- Defined in ‘GHC.Internal.Classes’
+instance Integral Int -- Defined in ‘GHC.Internal.Real’
type instance A Int Int = () -- Defined at T4175.hs:9:15
type instance D Int () = String -- Defined at T4175.hs:20:10
type Z :: * -> Constraint
=====================================
testsuite/tests/ghci/scripts/T8469.stdout
=====================================
@@ -1,12 +1,12 @@
type Int :: *
data Int = GHC.Internal.Types.I# GHC.Internal.Prim.Int#
-- Defined in ‘GHC.Internal.Types’
-instance Bounded Int -- Defined in ‘GHC.Internal.Enum’
+instance Eq Int -- Defined in ‘GHC.Internal.Classes’
+instance Ord Int -- Defined in ‘GHC.Internal.Classes’
instance Read Int -- Defined in ‘GHC.Internal.Read’
+instance Bounded Int -- Defined in ‘GHC.Internal.Enum’
instance Enum Int -- Defined in ‘GHC.Internal.Enum’
-instance Eq Int -- Defined in ‘GHC.Internal.Classes’
-instance Integral Int -- Defined in ‘GHC.Internal.Real’
instance Num Int -- Defined in ‘GHC.Internal.Num’
-instance Ord Int -- Defined in ‘GHC.Internal.Classes’
instance Real Int -- Defined in ‘GHC.Internal.Real’
instance Show Int -- Defined in ‘GHC.Internal.Show’
+instance Integral Int -- Defined in ‘GHC.Internal.Real’
=====================================
testsuite/tests/ghci/scripts/T8535.stdout
=====================================
@@ -2,10 +2,10 @@ type (->) :: * -> * -> *
type (->) = FUN Many
-- Defined in ‘GHC.Internal.Types’
infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
instance Monoid b => Monoid (a -> b)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup b => Semigroup (a -> b)
-- Defined in ‘GHC.Internal.Base’
-instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
=====================================
testsuite/tests/ghci/scripts/T9881.stdout
=====================================
@@ -4,16 +4,16 @@ data Data.ByteString.Lazy.ByteString
| Data.ByteString.Lazy.Internal.Chunk {-# UNPACK #-} !StrictByteString
Data.ByteString.Lazy.ByteString
-- Defined in ‘Data.ByteString.Lazy.Internal’
+instance Eq Data.ByteString.Lazy.ByteString
+ -- Defined in ‘Data.ByteString.Lazy.Internal’
instance Monoid Data.ByteString.Lazy.ByteString
-- Defined in ‘Data.ByteString.Lazy.Internal’
+instance Ord Data.ByteString.Lazy.ByteString
+ -- Defined in ‘Data.ByteString.Lazy.Internal’
instance Semigroup Data.ByteString.Lazy.ByteString
-- Defined in ‘Data.ByteString.Lazy.Internal’
instance Read Data.ByteString.Lazy.ByteString
-- Defined in ‘Data.ByteString.Lazy.Internal’
-instance Eq Data.ByteString.Lazy.ByteString
- -- Defined in ‘Data.ByteString.Lazy.Internal’
-instance Ord Data.ByteString.Lazy.ByteString
- -- Defined in ‘Data.ByteString.Lazy.Internal’
instance Show Data.ByteString.Lazy.ByteString
-- Defined in ‘Data.ByteString.Lazy.Internal’
@@ -23,15 +23,15 @@ data Data.ByteString.ByteString
GHC.Internal.Word.Word8)
{-# UNPACK #-} !Int
-- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
+instance Eq Data.ByteString.ByteString
+ -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
instance Monoid Data.ByteString.ByteString
-- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
+instance Ord Data.ByteString.ByteString
+ -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
instance Semigroup Data.ByteString.ByteString
-- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
instance Read Data.ByteString.ByteString
-- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
-instance Eq Data.ByteString.ByteString
- -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
-instance Ord Data.ByteString.ByteString
- -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
instance Show Data.ByteString.ByteString
-- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’
=====================================
testsuite/tests/ghci/scripts/ghci020.stdout
=====================================
@@ -2,10 +2,10 @@ type (->) :: * -> * -> *
type (->) = FUN Many
-- Defined in ‘GHC.Internal.Types’
infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
instance Monoid b => Monoid (a -> b)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup b => Semigroup (a -> b)
-- Defined in ‘GHC.Internal.Base’
-instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
=====================================
testsuite/tests/ghci/scripts/ghci064.stdout
=====================================
@@ -1,52 +1,52 @@
-instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
-instance Traversable Maybe
- -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Base.Alternative Maybe
-- Defined in ‘GHC.Internal.Base’
instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’
instance Functor Maybe -- Defined in ‘GHC.Internal.Base’
-instance MonadFail Maybe
- -- Defined in ‘GHC.Internal.Control.Monad.Fail’
+instance Monad Maybe -- Defined in ‘GHC.Internal.Base’
instance GHC.Internal.Base.MonadPlus Maybe
-- Defined in ‘GHC.Internal.Base’
-instance Monad Maybe -- Defined in ‘GHC.Internal.Base’
+instance MonadFail Maybe
+ -- Defined in ‘GHC.Internal.Control.Monad.Fail’
+instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
+instance Traversable Maybe
+ -- Defined in ‘GHC.Internal.Data.Traversable’
+instance [safe] Eq w => Eq (Maybe w)
+ -- Defined in ‘GHC.Internal.Maybe’
instance Semigroup w => Monoid (Maybe w)
-- Defined in ‘GHC.Internal.Base’
-instance Read w => Read (Maybe w) -- Defined in ‘GHC.Internal.Read’
-instance Semigroup w => Semigroup (Maybe w)
- -- Defined in ‘GHC.Internal.Base’
instance [safe] Ord w => Ord (Maybe w)
-- Defined in ‘GHC.Internal.Maybe’
+instance Semigroup w => Semigroup (Maybe w)
+ -- Defined in ‘GHC.Internal.Base’
+instance Read w => Read (Maybe w) -- Defined in ‘GHC.Internal.Read’
instance Show w => Show (Maybe w) -- Defined in ‘GHC.Internal.Show’
-instance [safe] Eq w => Eq (Maybe w)
- -- Defined in ‘GHC.Internal.Maybe’
-instance Read w => Read [w] -- Defined in ‘GHC.Internal.Read’
-instance Ord w => Ord [w] -- Defined in ‘GHC.Internal.Classes’
-instance Show w => Show [w] -- Defined in ‘GHC.Internal.Show’
instance Eq w => Eq [w] -- Defined in ‘GHC.Internal.Classes’
instance Monoid [w] -- Defined in ‘GHC.Internal.Base’
+instance Ord w => Ord [w] -- Defined in ‘GHC.Internal.Classes’
instance Semigroup [w] -- Defined in ‘GHC.Internal.Base’
+instance Read w => Read [w] -- Defined in ‘GHC.Internal.Read’
+instance Show w => Show [w] -- Defined in ‘GHC.Internal.Show’
instance [safe] MyShow w => MyShow [w]
-- Defined at ghci064.hs:8:10
instance Monoid [T] -- Defined in ‘GHC.Internal.Base’
instance Semigroup [T] -- Defined in ‘GHC.Internal.Base’
instance [safe] MyShow [T] -- Defined at ghci064.hs:16:10
instance [safe] MyShow [T] -- Defined at ghci064.hs:8:10
-instance GHC.Internal.Foreign.Storable.Storable Bool
- -- Defined in ‘GHC.Internal.Foreign.Storable’
-instance GHC.Internal.Bits.Bits Bool
- -- Defined in ‘GHC.Internal.Bits’
+instance Eq Bool -- Defined in ‘GHC.Internal.Classes’
+instance Ord Bool -- Defined in ‘GHC.Internal.Classes’
+instance Read Bool -- Defined in ‘GHC.Internal.Read’
instance Bounded Bool -- Defined in ‘GHC.Internal.Enum’
instance Enum Bool -- Defined in ‘GHC.Internal.Enum’
+instance Show Bool -- Defined in ‘GHC.Internal.Show’
+instance GHC.Internal.Ix.Ix Bool -- Defined in ‘GHC.Internal.Ix’
+instance GHC.Internal.Bits.Bits Bool
+ -- Defined in ‘GHC.Internal.Bits’
instance GHC.Internal.Bits.FiniteBits Bool
-- Defined in ‘GHC.Internal.Bits’
-instance GHC.Internal.Ix.Ix Bool -- Defined in ‘GHC.Internal.Ix’
-instance Ord Bool -- Defined in ‘GHC.Internal.Classes’
-instance Read Bool -- Defined in ‘GHC.Internal.Read’
-instance Show Bool -- Defined in ‘GHC.Internal.Show’
-instance Eq Bool -- Defined in ‘GHC.Internal.Classes’
-instance Traversable ((,) Int)
- -- Defined in ‘GHC.Internal.Data.Traversable’
+instance GHC.Internal.Foreign.Storable.Storable Bool
+ -- Defined in ‘GHC.Internal.Foreign.Storable’
+instance Functor ((,) Int) -- Defined in ‘GHC.Internal.Base’
instance Foldable ((,) Int)
-- Defined in ‘GHC.Internal.Data.Foldable’
-instance Functor ((,) Int) -- Defined in ‘GHC.Internal.Base’
+instance Traversable ((,) Int)
+ -- Defined in ‘GHC.Internal.Data.Traversable’
=====================================
testsuite/tests/ghci/should_run/T10145.stdout
=====================================
@@ -2,10 +2,10 @@ type (->) :: * -> * -> *
type (->) = FUN Many
-- Defined in ‘GHC.Internal.Types’
infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
instance Monoid b => Monoid (a -> b)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup b => Semigroup (a -> b)
-- Defined in ‘GHC.Internal.Base’
-instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
=====================================
testsuite/tests/ghci/should_run/T18594.stdout
=====================================
@@ -2,13 +2,13 @@ type (->) :: * -> * -> *
type (->) = FUN Many
-- Defined in ‘GHC.Internal.Types’
infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
instance Monoid b => Monoid (a -> b)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup b => Semigroup (a -> b)
-- Defined in ‘GHC.Internal.Base’
-instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’
-instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’
type Constraint :: *
type Constraint = CONSTRAINT LiftedRep
-- Defined in ‘GHC.Internal.Types’
=====================================
testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
=====================================
@@ -21,7 +21,7 @@ TYPE SIGNATURES
(>>) :: forall {m :: * -> *} {a} {b}. Monad m => m a -> m b -> m b
(>>=) ::
forall {m :: * -> *} {a} {b}. Monad m => m a -> (a -> m b) -> m b
- (^) :: forall {b} {a}. (Integral b, Num a) => a -> b -> a
+ (^) :: forall {a} {b}. (Num a, Integral b) => a -> b -> a
(^^) :: forall {a} {b}. (Fractional a, Integral b) => a -> b -> a
abs :: forall {a}. Num a => a -> a
acos :: forall {a}. Floating a => a -> a
@@ -236,4 +236,4 @@ TYPE SIGNATURES
(a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
(||) :: Bool -> Bool -> Bool
Dependent modules: []
-Dependent packages: [(normal, base-4.21.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
=====================================
testsuite/tests/roles/should_compile/Roles14.stderr
=====================================
@@ -4,7 +4,7 @@ TYPE CONSTRUCTORS
class C2{1} :: * -> Constraint
roles representational
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
Roles12.$tcC2 [InlPrag=[~]]
@@ -15,14 +15,14 @@ Roles12.$tc'C:C2 [InlPrag=[~]]
= GHC.Internal.Types.TyCon
7087988437584478859#Word64 11477953550142401435#Word64
Roles12.$trModule (GHC.Internal.Types.TrNameS "'C:C2"#) 1# $krep
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp Roles12.$tcC2 ((:) $krep [])
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepFun
GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp Roles12.$tcC2 ((:) $krep [])
Roles12.$trModule [InlPrag=[~]]
= GHC.Internal.Types.Module
(GHC.Internal.Types.TrNameS "main"#)
=====================================
testsuite/tests/roles/should_compile/Roles3.stderr
=====================================
@@ -16,7 +16,7 @@ TYPE CONSTRUCTORS
roles nominal
type synonym Syn2{1} :: * -> *
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
Roles3.$tcC4 [InlPrag=[~]]
@@ -43,15 +43,6 @@ Roles3.$tc'C:C1 [InlPrag=[~]]
= GHC.Internal.Types.TyCon
4508088879886988796#Word64 13962145553903222779#Word64
Roles3.$trModule (GHC.Internal.Types.TrNameS "'C:C1"#) 1# $krep
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp
- GHC.Internal.Types.$tc~
- ((:) GHC.Internal.Types.krep$* ((:) $krep ((:) $krep [])))
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp
- Roles3.$tcC2 ((:) $krep ((:) $krep []))
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp Roles3.$tcC1 ((:) $krep [])
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
@@ -64,6 +55,15 @@ $krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepFun
GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp
+ GHC.Internal.Types.$tc~
+ ((:) GHC.Internal.Types.krep$* ((:) $krep ((:) $krep [])))
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp
+ Roles3.$tcC2 ((:) $krep ((:) $krep []))
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp Roles3.$tcC1 ((:) $krep [])
Roles3.$trModule [InlPrag=[~]]
= GHC.Internal.Types.Module
(GHC.Internal.Types.TrNameS "main"#)
=====================================
testsuite/tests/roles/should_compile/Roles4.stderr
=====================================
@@ -6,7 +6,7 @@ TYPE CONSTRUCTORS
class C3{1} :: * -> Constraint
type synonym Syn1{1} :: * -> *
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
Roles4.$tcC3 [InlPrag=[~]]
@@ -25,10 +25,6 @@ Roles4.$tc'C:C1 [InlPrag=[~]]
= GHC.Internal.Types.TyCon
3870707671502302648#Word64 10631907186261837450#Word64
Roles4.$trModule (GHC.Internal.Types.TrNameS "'C:C1"#) 1# $krep
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC3 ((:) $krep [])
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC1 ((:) $krep [])
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
@@ -40,6 +36,10 @@ $krep [InlPrag=[~]]
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepTyConApp
GHC.Internal.Types.$tcList ((:) $krep [])
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC3 ((:) $krep [])
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC1 ((:) $krep [])
Roles4.$trModule [InlPrag=[~]]
= GHC.Internal.Types.Module
(GHC.Internal.Types.TrNameS "main"#)
=====================================
testsuite/tests/roles/should_compile/T8958.stderr
=====================================
@@ -18,7 +18,7 @@ CLASS INSTANCES
instance [incoherent] Representational a
-- Defined at T8958.hs:11:10
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
T8958.$tcMap [InlPrag=[~]]
@@ -50,10 +50,10 @@ T8958.$tc'C:Nominal [InlPrag=[~]]
T8958.$trModule (GHC.Internal.Types.TrNameS "'C:Nominal"#) 1# $krep
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1
-$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepFun
GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint
+$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepTyConApp
GHC.Internal.Tuple.$tcTuple2
=====================================
testsuite/tests/typecheck/should_compile/T18406b.stderr
=====================================
@@ -4,7 +4,7 @@ TYPE SIGNATURES
TYPE CONSTRUCTORS
class C{2} :: * -> * -> Constraint
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
Bug.$tcC [InlPrag=[~]]
@@ -15,13 +15,6 @@ Bug.$tc'C:C [InlPrag=[~]]
= GHC.Internal.Types.TyCon
302756782745842909#Word64 14248103394115774781#Word64 Bug.$trModule
(GHC.Internal.Types.TrNameS "'C:C"#) 2# $krep
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp
- Bug.$tcC
- ((:) @GHC.Internal.Types.KindRep
- $krep
- ((:) @GHC.Internal.Types.KindRep
- $krep [] @GHC.Internal.Types.KindRep))
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
@@ -31,6 +24,13 @@ $krep [InlPrag=[~]]
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepFun
GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp
+ Bug.$tcC
+ ((:) @GHC.Internal.Types.KindRep
+ $krep
+ ((:) @GHC.Internal.Types.KindRep
+ $krep [] @GHC.Internal.Types.KindRep))
Bug.$trModule [InlPrag=[~]]
= GHC.Internal.Types.Module
(GHC.Internal.Types.TrNameS "main"#)
=====================================
testsuite/tests/typecheck/should_compile/T18529.stderr
=====================================
@@ -4,7 +4,7 @@ TYPE SIGNATURES
TYPE CONSTRUCTORS
class C{2} :: * -> * -> Constraint
Dependent modules: []
-Dependent packages: [(normal, base-4.22.0.0)]
+Dependent packages: [(normal, base-4.23.0.0)]
==================== Typechecker ====================
Bug.$tcC [InlPrag=[~]]
@@ -15,13 +15,6 @@ Bug.$tc'C:C [InlPrag=[~]]
= GHC.Internal.Types.TyCon
302756782745842909#Word64 14248103394115774781#Word64 Bug.$trModule
(GHC.Internal.Types.TrNameS "'C:C"#) 2# $krep
-$krep [InlPrag=[~]]
- = GHC.Internal.Types.KindRepTyConApp
- Bug.$tcC
- ((:) @GHC.Internal.Types.KindRep
- $krep
- ((:) @GHC.Internal.Types.KindRep
- $krep [] @GHC.Internal.Types.KindRep))
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1
$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep
@@ -35,6 +28,13 @@ $krep [InlPrag=[~]]
$krep [InlPrag=[~]]
= GHC.Internal.Types.KindRepTyConApp
GHC.Internal.Tuple.$tcUnit [] @GHC.Internal.Types.KindRep
+$krep [InlPrag=[~]]
+ = GHC.Internal.Types.KindRepTyConApp
+ Bug.$tcC
+ ((:) @GHC.Internal.Types.KindRep
+ $krep
+ ((:) @GHC.Internal.Types.KindRep
+ $krep [] @GHC.Internal.Types.KindRep))
Bug.$trModule [InlPrag=[~]]
= GHC.Internal.Types.Module
(GHC.Internal.Types.TrNameS "main"#)
=====================================
testsuite/tests/typecheck/should_fail/T5300.stderr
=====================================
@@ -1,4 +1,3 @@
-
T5300.hs:12:7: error: [GHC-39999]
• Could not deduce ‘C1 a b c0’
from the context: (Monad m, C1 a b c)
@@ -14,16 +13,17 @@ T5300.hs:12:7: error: [GHC-39999]
f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a
T5300.hs:15:7: error: [GHC-39999]
- • Could not deduce ‘C1 a1 b1 c10’
+ • Could not deduce ‘C2 a2 b2 c20’
from the context: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2)
bound by the type signature for:
f2 :: forall (m :: * -> *) a1 b1 c1 a2 b2 c2.
(Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
a1 -> StateT (T b2) m a2
at T5300.hs:15:7-69
- The type variable ‘c10’ is ambiguous
+ The type variable ‘c20’ is ambiguous
• In the ambiguity check for ‘f2’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature:
f2 :: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
a1 -> StateT (T b2) m a2
+
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ca86939588c4ddd10b56c7be42ed076…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ca86939588c4ddd10b56c7be42ed076…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
22 Jul '26
Simon Jakobi pushed new branch wip/sjakobi/T27521 at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/sjakobi/T27521
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0