[Git][ghc/ghc][wip/T26503] 2 commits: Unify HsString + HsMultilineString
by Brandon Chinn (@brandonchinn178) 29 Jan '26
by Brandon Chinn (@brandonchinn178) 29 Jan '26
29 Jan '26
Brandon Chinn pushed to branch wip/T26503 at Glasgow Haskell Compiler / GHC
Commits:
40968332 by Brandon Chinn at 2026-01-29T15:32:18-08:00
Unify HsString + HsMultilineString
- - - - -
769c384e by Brandon Chinn at 2026-01-29T15:45:00-08:00
Implement QualifiedStrings (#26503)
See Note [Implementation of QualifiedStrings]
- - - - -
72 changed files:
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/String.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Error/Codes.hs
- + compiler/GHC/Types/StringMeta.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.16.1-notes.rst
- + docs/users_guide/exts/qualified_strings.rst
- libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Lib.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs
- libraries/template-haskell/Language/Haskell/TH/Lib.hs
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/driver/T4437.hs
- testsuite/tests/ghc-api/annotations-literals/literals.stdout
- testsuite/tests/ghc-api/annotations-literals/parsed.hs
- testsuite/tests/ghc-api/annotations-literals/parsed.stdout
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
- + testsuite/tests/qualified-strings/Makefile
- + testsuite/tests/qualified-strings/should_compile/Example/Length.hs
- + testsuite/tests/qualified-strings/should_compile/all.T
- + testsuite/tests/qualified-strings/should_compile/qstrings_redundant_pattern.hs
- + testsuite/tests/qualified-strings/should_compile/qstrings_redundant_pattern.stderr
- + testsuite/tests/qualified-strings/should_fail/Example/Length.hs
- + testsuite/tests/qualified-strings/should_fail/Makefile
- + testsuite/tests/qualified-strings/should_fail/all.T
- + testsuite/tests/qualified-strings/should_fail/qstrings_bad_expr.hs
- + testsuite/tests/qualified-strings/should_fail/qstrings_bad_expr.stderr
- + testsuite/tests/qualified-strings/should_fail/qstrings_bad_pat.hs
- + testsuite/tests/qualified-strings/should_fail/qstrings_bad_pat.stderr
- + testsuite/tests/qualified-strings/should_fail/qstrings_multiline_no_ext.hs
- + testsuite/tests/qualified-strings/should_fail/qstrings_multiline_no_ext.stderr
- + testsuite/tests/qualified-strings/should_run/Example/ByteStringAscii.hs
- + testsuite/tests/qualified-strings/should_run/Example/ByteStringUtf8.hs
- + testsuite/tests/qualified-strings/should_run/Example/Text.hs
- + testsuite/tests/qualified-strings/should_run/Makefile
- + testsuite/tests/qualified-strings/should_run/all.T
- + testsuite/tests/qualified-strings/should_run/qstrings_expr.hs
- + testsuite/tests/qualified-strings/should_run/qstrings_expr.stdout
- + testsuite/tests/qualified-strings/should_run/qstrings_pat.hs
- + testsuite/tests/qualified-strings/should_run/qstrings_pat.stdout
- + testsuite/tests/qualified-strings/should_run/qstrings_th.hs
- + testsuite/tests/qualified-strings/should_run/qstrings_th.stdout
- utils/check-exact/ExactPrint.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c811b1db19a5c693266c24afcd1cea…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c811b1db19a5c693266c24afcd1cea…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
29 Jan '26
Andreas Klebinger pushed to branch wip/andreask/linker_fix at Glasgow Haskell Compiler / GHC
Commits:
3809f281 by Andreas Klebinger at 2026-01-29T23:08:53+01:00
wobble
- - - - -
1 changed file:
- rts/linker/MachO.c
Changes:
=====================================
rts/linker/MachO.c
=====================================
@@ -175,7 +175,7 @@ resolveImports(
int
ocAllocateExtras_MachO(ObjectCode* oc)
{
- IF_DEBUG(linker, DEBUG_LOG("ocAllocateExtras_MachO: start\n"));
+ IF_DEBUG(linker, debugBelch("ocAllocateExtras_MachO: start\n"));
if (NULL != oc->info->symCmd) {
IF_DEBUG(linker,
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3809f2819423fbb5e732d38573b1dda…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3809f2819423fbb5e732d38573b1dda…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26699] Decouple `L.S.H.Decls` from importing `GHC.Types.Basic`
by recursion-ninja (@recursion-ninja) 29 Jan '26
by recursion-ninja (@recursion-ninja) 29 Jan '26
29 Jan '26
recursion-ninja pushed to branch wip/26699 at Glasgow Haskell Compiler / GHC
Commits:
6995cc5f by Recursion Ninja at 2026-01-29T16:38:40-05:00
Decouple `L.S.H.Decls` from importing `GHC.Types.Basic`
Data-types within `GHC.Types.Basic` which describe components of
the AST are migrated to `Language.Haskell.Syntax.Basic`. Related
function definitions are also moved.
Migrated types:
* TopLevelFlag
* RuleName
* TyConFlavour
* TypeOrData
* NewOrData
Migrated instances:
* `Outputable` instances moved to in `GHC.Utils.Outputable`
* `Binary` instance of `Boxity` moved to to `GHC.Utils.Binary`
* Other `Binary` instances are orphans to be migrated later.
The `OverlapMode` data-type is given a TTG extension point.
The `OverlapFlag` data-type, which depends on `OverlapMode`,
is updated to support `OverlapMode` with a GHC "pass" type paramerter.
In order to avoid module import cycles, `OverlapMode` and `OverlapFlag`
are migrated to new modules (no way around this).
* Migrated `OverlapMode` to new module `Language.Haskell.Syntax.Overlap`
* Migrated `OverlapFlag` to new module `GHC.Hs.Decls.Overlap`
Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita(a)gmail.com>
- - - - -
37 changed files:
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Hs/Decls.hs
- + compiler/GHC/Hs/Decls/Overlap.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Parser.y
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Name.hs
- 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/Decls.hs
- + compiler/Language/Haskell/Syntax/Decls/Overlap.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/ghc.cabal.in
- utils/check-exact/ExactPrint.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6995cc5fca4473fff52e050ea993557…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6995cc5fca4473fff52e050ea993557…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26699] Apply 1 suggestion(s) to 1 file(s)
by recursion-ninja (@recursion-ninja) 29 Jan '26
by recursion-ninja (@recursion-ninja) 29 Jan '26
29 Jan '26
recursion-ninja pushed to branch wip/26699 at Glasgow Haskell Compiler / GHC
Commits:
5e2da544 by recursion-ninja at 2026-01-29T21:28:03+00:00
Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita(a)gmail.com>
- - - - -
1 changed file:
- compiler/GHC/Hs/Decls/Overlap.hs
Changes:
=====================================
compiler/GHC/Hs/Decls/Overlap.hs
=====================================
@@ -5,8 +5,7 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
{- Necessary for the following instances:
* (type class): Binary OverlapMode
- * (type family): XOverlapMode (GhcPass p)
- * (type family): XXOverlapMode (GhcPass p)
+ * (type class): NFData OverlapMode
-}
{- |
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5e2da544b21f800b1dfd3b8605153aa…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5e2da544b21f800b1dfd3b8605153aa…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26699] Add TTG extension point to 'OverlapMode'
by recursion-ninja (@recursion-ninja) 29 Jan '26
by recursion-ninja (@recursion-ninja) 29 Jan '26
29 Jan '26
recursion-ninja pushed to branch wip/26699 at Glasgow Haskell Compiler / GHC
Commits:
76bbbe23 by Recursion Ninja at 2026-01-29T16:01:16-05:00
Add TTG extension point to 'OverlapMode'
Migrate OverlapMode to new module Language.Haskell.Syntax.Overlap
Migrate OverlapFlag to new module GHC.Hs.Decls.Overlap
- - - - -
26 changed files:
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Hs/Decls.hs
- + compiler/GHC/Hs/Decls/Overlap.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Parser.y
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Name.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- + compiler/Language/Haskell/Syntax/Decls/Overlap.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/ghc.cabal.in
- utils/check-exact/ExactPrint.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
Changes:
=====================================
compiler/GHC/Core/InstEnv.hs
=====================================
@@ -10,7 +10,7 @@ The bits common to GHC.Tc.TyCl.Instance and GHC.Tc.Deriv.
module GHC.Core.InstEnv (
DFunId, InstMatch, ClsInstLookupResult,
CanonicalEvidence(..), PotentialUnifiers(..), getCoherentUnifiers, nullUnifiers,
- OverlapFlag(..), OverlapMode(..), setOverlapModeMaybe,
+ OverlapFlag(..), OverlapMode(..),
ClsInst(..), DFunInstType, pprInstance, pprInstanceHdr, pprDFunId, pprInstances,
instanceWarning, instanceHead, instanceSig, mkLocalClsInst, mkImportedClsInst,
instanceDFunId, updateClsInstDFuns, updateClsInstDFun,
@@ -40,6 +40,7 @@ import GHC.Core.RoughMap
import GHC.Core.Class
import GHC.Core.Unify
import GHC.Core.FVs( orphNamesOfTypes, orphNamesOfType )
+import GHC.Hs.Decls.Overlap
import GHC.Hs.Extension
import GHC.Unit.Module.Env
@@ -50,7 +51,6 @@ import GHC.Types.Unique.DSet
import GHC.Types.Var.Set
import GHC.Types.Name
import GHC.Types.Name.Set
-import GHC.Types.Basic
import GHC.Types.Id
import GHC.Generics (Generic)
import Data.List.NonEmpty ( NonEmpty (..), nonEmpty )
=====================================
compiler/GHC/Hs/Decls.hs
=====================================
@@ -100,13 +100,17 @@ module GHC.Hs.Decls (
-- friends:
import GHC.Prelude
+import Language.Haskell.Syntax.Binds
import Language.Haskell.Syntax.Decls
+import Language.Haskell.Syntax.Decls.Overlap (OverlapMode(..))
import Language.Haskell.Syntax.Extension
-import {-# SOURCE #-} GHC.Hs.Expr ( pprExpr, pprUntypedSplice )
+import {-# SOURCE #-} GHC.Hs.Expr (pprExpr, pprUntypedSplice)
-- Because Expr imports Decls via HsBracket
-import GHC.Hs.Binds
+import GHC.Hs.Binds (ActivationAnn(..),
+ emptyValBindsIn, emptyValBindsOut, isEmptyValBinds,
+ plusHsValBinds, pprDeclList, pprLHsBindsForUser)
import GHC.Hs.Type
import GHC.Hs.Doc
import GHC.Types.Basic
@@ -1061,7 +1065,7 @@ ppDerivStrategy mb =
Nothing -> empty
Just (L _ ds) -> ppr ds
-ppOverlapPragma :: Maybe (LocatedP OverlapMode) -> SDoc
+ppOverlapPragma :: Maybe (LocatedP (OverlapMode (GhcPass p))) -> SDoc
ppOverlapPragma mb =
case mb of
Nothing -> empty
@@ -1489,7 +1493,7 @@ type instance Anno (ClsInstDecl (GhcPass p)) = SrcSpanAnnA
type instance Anno (InstDecl (GhcPass p)) = SrcSpanAnnA
type instance Anno (DocDecl (GhcPass p)) = SrcSpanAnnA
type instance Anno (DerivDecl (GhcPass p)) = SrcSpanAnnA
-type instance Anno OverlapMode = SrcSpanAnnP
+type instance Anno (OverlapMode (GhcPass p)) = SrcSpanAnnP
type instance Anno (DerivStrategy (GhcPass p)) = EpAnnCO
type instance Anno (DefaultDecl (GhcPass p)) = SrcSpanAnnA
type instance Anno (ForeignDecl (GhcPass p)) = SrcSpanAnnA
=====================================
compiler/GHC/Hs/Decls/Overlap.hs
=====================================
@@ -0,0 +1,108 @@
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE UndecidableInstances #-} -- XOverlapMode, XXOverlapMode
+
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+{- Necessary for the following instances:
+ * (type class): Binary OverlapMode
+ * (type family): XOverlapMode (GhcPass p)
+ * (type family): XXOverlapMode (GhcPass p)
+-}
+
+{- |
+Data-types describing the overlap annotations for instances as well as
+interpreting the instances usage within the Safe Haskell context.
+-}
+module GHC.Hs.Decls.Overlap (
+ -- * OverlapFlag
+ -- ** Data-type
+ OverlapFlag(..),
+
+ -- * OverlapMode
+ -- ** Data-type
+ OverlapMode(..),
+ -- ** Queries
+ hasOverlappableFlag,
+ hasOverlappingFlag,
+ hasIncoherentFlag,
+ hasNonCanonicalFlag,
+ ) where
+
+import GHC.Prelude
+
+import GHC.Hs.Extension
+
+import Language.Haskell.Syntax.Decls.Overlap
+import Language.Haskell.Syntax.Extension
+
+import GHC.Types.SourceText
+import GHC.Utils.Binary
+import GHC.Utils.Outputable
+
+import Control.DeepSeq (NFData(..))
+
+{-
+************************************************************************
+* *
+ Instance overlap flag
+* *
+************************************************************************
+-}
+
+-- | The semantics allowed for overlapping instances for a particular
+-- instance. See Note [Safe Haskell isSafeOverlap] in GHC.Core.InstEnv for a
+-- explanation of the `isSafeOverlap` field.
+data OverlapFlag = OverlapFlag
+ { isSafeOverlap :: Bool
+ , overlapMode :: OverlapMode GhcTc
+ } deriving (Eq)
+
+instance Binary OverlapFlag where
+ put_ bh flag = do put_ bh (overlapMode flag)
+ put_ bh (isSafeOverlap flag)
+ get bh = do
+ h <- get bh
+ b <- get bh
+ return OverlapFlag { isSafeOverlap = b, overlapMode = h }
+
+instance NFData OverlapFlag where
+ rnf (OverlapFlag mode safe) = rnf mode `seq` rnf safe
+
+instance Outputable OverlapFlag where
+ ppr flag = ppr (overlapMode flag) <+> pprSafeOverlap (isSafeOverlap flag)
+
+type instance XOverlapMode (GhcPass _) = SourceText
+
+type instance XXOverlapMode (GhcPass _) = DataConCantHappen
+
+instance NFData (OverlapMode (GhcPass p)) where
+ rnf = \case
+ NoOverlap s -> rnf s
+ Overlappable s -> rnf s
+ Overlapping s -> rnf s
+ Overlaps s -> rnf s
+ Incoherent s -> rnf s
+ NonCanonical s -> rnf s
+
+instance Binary (OverlapMode (GhcPass p)) where
+ put_ bh = \case
+ NoOverlap s -> putByte bh 0 >> put_ bh s
+ Overlaps s -> putByte bh 1 >> put_ bh s
+ Incoherent s -> putByte bh 2 >> put_ bh s
+ Overlapping s -> putByte bh 3 >> put_ bh s
+ Overlappable s -> putByte bh 4 >> put_ bh s
+ NonCanonical s -> putByte bh 5 >> put_ bh s
+
+ get bh = do
+ h <- getByte bh
+ case h of
+ 0 -> get bh >>= \s -> return $ NoOverlap s
+ 1 -> get bh >>= \s -> return $ Overlaps s
+ 2 -> get bh >>= \s -> return $ Incoherent s
+ 3 -> get bh >>= \s -> return $ Overlapping s
+ 4 -> get bh >>= \s -> return $ Overlappable s
+ _ -> get bh >>= \s -> return $ NonCanonical s
+
+pprSafeOverlap :: Bool -> SDoc
+pprSafeOverlap True = text "[safe]"
+pprSafeOverlap False = empty
=====================================
compiler/GHC/Hs/Instances.hs
=====================================
@@ -33,6 +33,7 @@ import GHC.Types.Name.Reader (WithUserRdr(..))
import GHC.Types.InlinePragma (ActivationGhc)
import GHC.Data.BooleanFormula (BooleanFormula(..))
import Language.Haskell.Syntax.Decls
+import Language.Haskell.Syntax.Decls.Overlap (OverlapMode(..))
import Language.Haskell.Syntax.Extension (Anno)
import Language.Haskell.Syntax.Binds.InlinePragma (ActivationX(..), InlinePragma(..))
@@ -642,3 +643,8 @@ deriving instance Data ActivationGhc
deriving instance Data (InlinePragma GhcPs)
deriving instance Data (InlinePragma GhcRn)
deriving instance Data (InlinePragma GhcTc)
+
+-- deriving instance Data (OverlapMode p)
+deriving instance Data (OverlapMode GhcPs)
+deriving instance Data (OverlapMode GhcRn)
+deriving instance Data (OverlapMode GhcTc)
=====================================
compiler/GHC/HsToCore/Quote.hs
=====================================
@@ -37,6 +37,7 @@ import GHC.HsToCore.Binds
import qualified GHC.Boot.TH.Syntax as TH
import GHC.Hs
+import GHC.Hs.Decls.Overlap ( OverlapMode(..) )
import GHC.Tc.Utils.TcType
import GHC.Tc.Types.Evidence
@@ -68,7 +69,6 @@ import qualified GHC.Data.List.NonEmpty as NE
import GHC.Types.SrcLoc as SrcLoc
import GHC.Types.Unique
-import GHC.Types.Basic
import GHC.Types.ForeignCall
import GHC.Types.Var
import GHC.Types.Id
@@ -2731,7 +2731,7 @@ repNewtypeStrategy = rep2 newtypeStrategyName []
repViaStrategy :: Core (M TH.Type) -> MetaM (Core (M TH.DerivStrategy))
repViaStrategy (MkC t) = rep2 viaStrategyName [t]
-repOverlap :: Maybe OverlapMode -> MetaM (Core (Maybe TH.Overlap))
+repOverlap :: Maybe (OverlapMode GhcRn) -> MetaM (Core (Maybe TH.Overlap))
repOverlap mb =
case mb of
Nothing -> nothing
=====================================
compiler/GHC/Iface/Ext/Ast.hs
=====================================
@@ -1718,7 +1718,7 @@ instance ToHie (RScoped (LocatedAn NoEpAnns (DerivStrategy GhcRn))) where
NewtypeStrategy _ -> []
ViaStrategy s -> [ toHie (TS (ResolvedScopes [sc]) s) ]
-instance ToHie (LocatedP OverlapMode) where
+instance ToHie (LocatedP (OverlapMode GhcRn)) where
toHie (L span _) = locOnly (locA span)
instance ToHie (LocatedA (ConDecl GhcRn)) where
=====================================
compiler/GHC/Iface/Syntax.hs
=====================================
@@ -85,6 +85,7 @@ import GHC.Builtin.Types ( constraintKindTyConName )
import GHC.Stg.EnforceEpt.TagSig
import GHC.Parser.Annotation (noLocA)
import GHC.Hs.Extension ( GhcRn )
+import GHC.Hs.Decls.Overlap ( OverlapFlag )
import GHC.Hs.Doc ( WithHsDocIdentifiers(..) )
import GHC.Utils.Lexeme (isLexSym)
=====================================
compiler/GHC/Parser.y
=====================================
@@ -43,6 +43,7 @@ import qualified Data.List.NonEmpty as NE
import qualified Prelude -- for happy-generated code
import GHC.Hs
+import GHC.Hs.Decls.Overlap ( OverlapMode(..) )
import GHC.Driver.Backpack.Syntax
@@ -1443,7 +1444,7 @@ inst_decl :: { LInstDecl GhcPs }
(fmap reverse $7)
(AnnDataDefn [] [] NoEpTok tnewtype tdata (epTok $2) dcolon twhere oc cc NoEpTok)}}
-overlap_pragma :: { Maybe (LocatedP OverlapMode) }
+overlap_pragma :: { Maybe (LocatedP (OverlapMode GhcPs)) }
: '{-# OVERLAPPABLE' '#-}' {% fmap Just $ amsr (sLL $1 $> (Overlappable (getOVERLAPPABLE_PRAGs $1)))
(AnnPragma (glR $1) (epTok $2) noAnn noAnn noAnn noAnn noAnn) }
| '{-# OVERLAPPING' '#-}' {% fmap Just $ amsr (sLL $1 $> (Overlapping (getOVERLAPPING_PRAGs $1)))
=====================================
compiler/GHC/Rename/Module.hs
=====================================
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE TypeFamilies #-}
@@ -21,6 +22,7 @@ import {-# SOURCE #-} GHC.Rename.Expr( rnLExpr )
import {-# SOURCE #-} GHC.Rename.Splice ( rnSpliceDecl, rnTopSpliceDecls )
import GHC.Hs
+import GHC.Hs.Decls.Overlap ( OverlapMode(..) )
import GHC.Rename.HsType
import GHC.Rename.Bind
@@ -582,7 +584,7 @@ rnClsInstDecl :: ClsInstDecl GhcPs -> RnM (ClsInstDecl GhcRn, FreeVars)
rnClsInstDecl (ClsInstDecl { cid_ext = (inst_warn_ps, _, _)
, cid_poly_ty = inst_ty, cid_binds = mbinds
, cid_sigs = uprags, cid_tyfam_insts = ats
- , cid_overlap_mode = oflag
+ , cid_overlap_mode = omode
, cid_datafam_insts = adts })
= do { rec { let ctxt = ClassInstanceCtx head_ty'
; checkInferredVars ctxt inst_ty
@@ -656,13 +658,14 @@ rnClsInstDecl (ClsInstDecl { cid_ext = (inst_warn_ps, _, _)
; (adts', adt_fvs) <- rnATInstDecls rnDataFamInstDecl cls ktv_names adts
; return ( (ats', adts'), at_fvs `plusFV` adt_fvs) }
+ ; let omode' = rnOverlapMode omode
; let all_fvs = meth_fvs `plusFV` more_fvs
`plusFV` inst_fvs
; inst_warn_rn <- mapM rnLWarningTxt inst_warn_ps
; return (ClsInstDecl { cid_ext = inst_warn_rn
, cid_poly_ty = inst_ty', cid_binds = mbinds'
, cid_sigs = uprags', cid_tyfam_insts = ats'
- , cid_overlap_mode = oflag
+ , cid_overlap_mode = omode'
, cid_datafam_insts = adts' },
all_fvs) }
-- We return the renamed associated data type declarations so
@@ -685,6 +688,18 @@ rnClsInstDecl (ClsInstDecl { cid_ext = (inst_warn_ps, _, _)
addErrAt l $ TcRnWithHsDocContext ctxt err_msg
pure $ mkUnboundName (mkTcOccFS (fsLit "<class>"))
+rnOverlapMode :: Maybe (XRec GhcPs (OverlapMode GhcPs))
+ -> Maybe (XRec GhcRn (OverlapMode GhcRn))
+rnOverlapMode =
+ let advancePass = \case
+ NoOverlap s -> NoOverlap s
+ Overlappable s -> Overlappable s
+ Overlapping s -> Overlapping s
+ Overlaps s -> Overlaps s
+ Incoherent s -> Incoherent s
+ NonCanonical s -> NonCanonical s
+ in fmap (fmap advancePass)
+
rnFamEqn :: HsDocContext
-> AssocTyFamInfo
-> FamEqn GhcPs rhs
@@ -1167,7 +1182,8 @@ rnSrcDerivDecl (DerivDecl (inst_warn_ps, ann) ty mds overlap)
NFC_StandaloneDerivedInstanceHead
(getLHsInstDeclHead $ dropWildCards ty')
; inst_warn_rn <- mapM rnLWarningTxt inst_warn_ps
- ; return (DerivDecl (inst_warn_rn, ann) ty' mds' overlap, fvs) }
+ ; let overlap' = rnOverlapMode overlap
+ ; return (DerivDecl (inst_warn_rn, ann) ty' mds' overlap', fvs) }
where
ctxt = DerivDeclCtx
nowc_ty = dropWildCards ty
=====================================
compiler/GHC/Tc/Deriv.hs
=====================================
@@ -763,7 +763,7 @@ deriveStandalone (L loc (DerivDecl (warn, _) deriv_ty mb_lderiv_strat overlap_mo
then do warnUselessTypeable
return Nothing
else do early_deriv_spec <-
- mkEqnHelp (fmap unLoc overlap_mode)
+ mkEqnHelp (fmap (tcOverlapMode . unLoc) overlap_mode)
tvs' cls inst_tys'
deriv_ctxt' mb_deriv_strat'
(fmap unLoc warn)
@@ -773,6 +773,16 @@ deriveStandalone (L loc (DerivDecl (warn, _) deriv_ty mb_lderiv_strat overlap_mo
early_deriv_spec
pure (Just early_deriv_spec) }
+
+tcOverlapMode :: OverlapMode GhcRn -> OverlapMode GhcTc
+tcOverlapMode = \case
+ NoOverlap s -> NoOverlap s
+ Overlappable s -> Overlappable s
+ Overlapping s -> Overlapping s
+ Overlaps s -> Overlaps s
+ Incoherent s -> Incoherent s
+ NonCanonical s -> NonCanonical s
+
-- Typecheck the type in a standalone deriving declaration.
--
-- This may appear dense, but it's mostly huffing and puffing to recognize
@@ -1218,7 +1228,7 @@ instance (at least from the user's perspective), the amount of engineering
required to obtain the latter instance just isn't worth it.
-}
-mkEqnHelp :: Maybe OverlapMode
+mkEqnHelp :: Maybe (OverlapMode GhcTc)
-> [TyVar]
-> Class -> [Type]
-> DerivContext
=====================================
compiler/GHC/Tc/Deriv/Utils.hs
=====================================
@@ -112,7 +112,7 @@ mkDerivOrigin standalone = DerivOrigin standalone
-- determining what its @EarlyDerivSpec@ should be.
-- See @Note [DerivEnv and DerivSpecMechanism]@.
data DerivEnv = DerivEnv
- { denv_overlap_mode :: Maybe OverlapMode
+ { denv_overlap_mode :: Maybe (OverlapMode GhcTc)
-- ^ Is this an overlapping instance?
, denv_tvs :: [TyVar]
-- ^ Universally quantified type variables in the instance. If the
@@ -167,7 +167,7 @@ data DerivSpec theta = DS { ds_loc :: SrcSpan
, ds_tys :: [Type]
, ds_skol_info :: SkolemInfo
, ds_user_ctxt :: UserTypeCtxt
- , ds_overlap :: Maybe OverlapMode
+ , ds_overlap :: Maybe (OverlapMode GhcTc)
, ds_standalone_wildcard :: Maybe SrcSpan
-- See Note [Inferring the instance context]
-- in GHC.Tc.Deriv.Infer
=====================================
compiler/GHC/Tc/Errors/Ppr.hs
=====================================
@@ -70,6 +70,7 @@ import GHC.CoreToIface
import GHC.Driver.Flags
import GHC.Driver.Backend
import GHC.Hs hiding (HoleError)
+import GHC.Hs.Decls.Overlap
import GHC.Tc.Errors.Types
import GHC.Tc.Errors.Types.PromotionErr (pprTermLevelUseCtxt)
=====================================
compiler/GHC/Tc/Utils/Instantiate.hs
=====================================
@@ -912,7 +912,7 @@ hasFixedRuntimeRepRes std_nm user_expr ty = mapM_ do_check mb_arity
************************************************************************
-}
-getOverlapFlag :: Maybe OverlapMode -- User pragma if any
+getOverlapFlag :: Maybe (OverlapMode (GhcPass p)) -- User pragma if any
-> TcM OverlapFlag
-- Construct the OverlapFlag from the global module flags,
-- but if the overlap_mode argument is (Just m),
@@ -946,18 +946,25 @@ getOverlapFlag overlap_mode_prag
-- See GHC.Core.InstEnv Note [Coherence and specialisation: overview]
final_overlap_mode
| Incoherent s <- overlap_mode
- , noncanonical_incoherence = NonCanonical s
- | otherwise = overlap_mode
+ , noncanonical_incoherence = NonCanonical s
+ | otherwise = overlap_mode
- ; return (OverlapFlag { isSafeOverlap = safeLanguageOn dflags
- , overlapMode = final_overlap_mode }) }
+ final_overlap_flag = OverlapFlag (safeLanguageOn dflags) $
+ case final_overlap_mode of
+ NoOverlap s -> NoOverlap s
+ Overlappable s -> Overlappable s
+ Overlapping s -> Overlapping s
+ Overlaps s -> Overlaps s
+ Incoherent s -> Incoherent s
+ NonCanonical s -> NonCanonical s
+ ; return $ final_overlap_flag }
tcGetInsts :: TcM [ClsInst]
-- Gets the local class instances.
tcGetInsts = fmap tcg_insts getGblEnv
-newClsInst :: Maybe OverlapMode -- User pragma
+newClsInst :: Maybe (OverlapMode (GhcPass p)) -- User pragma
-> Name -> [TyVar] -> ThetaType
-> Class -> [Type] -> Maybe (WarningTxt GhcRn) -> TcM ClsInst
newClsInst overlap_mode dfun_name tvs theta clas tys warn
=====================================
compiler/GHC/ThToHs.hs
=====================================
@@ -38,6 +38,7 @@ import GHC.Core.Type as Hs
import qualified GHC.Core.Coercion as Coercion ( Role(..) )
import GHC.Builtin.Types
import GHC.Builtin.Types.Prim( fUNTyCon )
+import GHC.Hs.Decls.Overlap as Hs
import GHC.Types.Basic as Hs
import GHC.Types.InlinePragma as Hs
import GHC.Types.ForeignCall
=====================================
compiler/GHC/Types/Basic.hs
=====================================
@@ -14,7 +14,14 @@ types that
\end{itemize}
-}
-{-# OPTIONS_GHC -Wno-orphans #-} -- Outputable PromotionFlag, Binary PromotionFlag, Outputable Boxity, Binay Boxity
+{-# OPTIONS_GHC -Wno-orphans #-}
+{-
+Above flag is necessary for these instances:
+ * Binary Boxity
+ * Binary PromotionFlag
+ * Outputable Boxity
+ * Outputable PromotionFlag
+-}
{-# LANGUAGE DerivingVia #-}
module GHC.Types.Basic (
@@ -40,9 +47,6 @@ module GHC.Types.Basic (
TopLevelFlag(..), isTopLevel, isNotTopLevel,
- OverlapFlag(..), OverlapMode(..), setOverlapModeMaybe,
- hasOverlappingFlag, hasOverlappableFlag, hasIncoherentFlag, hasNonCanonicalFlag,
-
Boxity(..), isBoxed,
CbvMark(..), isMarkedCbv,
@@ -107,13 +111,13 @@ import GHC.Utils.Outputable
import GHC.Utils.Panic
import GHC.Utils.Binary
import GHC.Types.Arity
-import GHC.Types.SourceText
+
import qualified GHC.LanguageExtensions as LangExt
import {-# SOURCE #-} Language.Haskell.Syntax.Type (PromotionFlag(..), isPromoted)
import {-# SOURCE #-} Language.Haskell.Syntax.Expr (HsDoFlavour)
import Language.Haskell.Syntax.Basic
-import Language.Haskell.Syntax.ImpExp
+import Language.Haskell.Syntax.ImpExp (ImportDeclLevel(..), ImportDeclLevelStyle(..))
import Control.DeepSeq ( NFData(..) )
import Data.Data
@@ -592,178 +596,6 @@ of whether we should do pattern-match checks; see the calls of the requiresPMC
function (e.g. isMatchContextPmChecked and needToRunPmCheck in GHC.HsToCore.Pmc.Utils).
-}
-{-
-************************************************************************
-* *
- Instance overlap flag
-* *
-************************************************************************
--}
-
--- | The semantics allowed for overlapping instances for a particular
--- instance. See Note [Safe Haskell isSafeOverlap] in GHC.Core.InstEnv for a
--- explanation of the `isSafeOverlap` field.
---
-
-data OverlapFlag = OverlapFlag
- { overlapMode :: OverlapMode
- , isSafeOverlap :: Bool
- } deriving (Eq, Data)
-
-setOverlapModeMaybe :: OverlapFlag -> Maybe OverlapMode -> OverlapFlag
-setOverlapModeMaybe f Nothing = f
-setOverlapModeMaybe f (Just m) = f { overlapMode = m }
-
-hasIncoherentFlag :: OverlapMode -> Bool
-hasIncoherentFlag mode =
- case mode of
- Incoherent _ -> True
- NonCanonical _ -> True
- _ -> False
-
-hasOverlappableFlag :: OverlapMode -> Bool
-hasOverlappableFlag mode =
- case mode of
- Overlappable _ -> True
- Overlaps _ -> True
- Incoherent _ -> True
- NonCanonical _ -> True
- _ -> False
-
-hasOverlappingFlag :: OverlapMode -> Bool
-hasOverlappingFlag mode =
- case mode of
- Overlapping _ -> True
- Overlaps _ -> True
- Incoherent _ -> True
- NonCanonical _ -> True
- _ -> False
-
-hasNonCanonicalFlag :: OverlapMode -> Bool
-hasNonCanonicalFlag = \case
- NonCanonical{} -> True
- _ -> False
-
-data OverlapMode -- See Note [Rules for instance lookup] in GHC.Core.InstEnv
- = NoOverlap SourceText
- -- See Note [Pragma source text]
- -- ^ This instance must not overlap another `NoOverlap` instance.
- -- However, it may be overlapped by `Overlapping` instances,
- -- and it may overlap `Overlappable` instances.
-
-
- | Overlappable SourceText
- -- See Note [Pragma source text]
- -- ^ Silently ignore this instance if you find a
- -- more specific one that matches the constraint
- -- you are trying to resolve
- --
- -- Example: constraint (Foo [Int])
- -- instance Foo [Int]
- -- instance {-# OVERLAPPABLE #-} Foo [a]
- --
- -- Since the second instance has the Overlappable flag,
- -- the first instance will be chosen (otherwise
- -- its ambiguous which to choose)
-
-
- | Overlapping SourceText
- -- See Note [Pragma source text]
- -- ^ Silently ignore any more general instances that may be
- -- used to solve the constraint.
- --
- -- Example: constraint (Foo [Int])
- -- instance {-# OVERLAPPING #-} Foo [Int]
- -- instance Foo [a]
- --
- -- Since the first instance has the Overlapping flag,
- -- the second---more general---instance will be ignored (otherwise
- -- it is ambiguous which to choose)
-
-
- | Overlaps SourceText
- -- See Note [Pragma source text]
- -- ^ Equivalent to having both `Overlapping` and `Overlappable` flags.
-
- | Incoherent SourceText
- -- See Note [Pragma source text]
- -- ^ Behave like Overlappable and Overlapping, and in addition pick
- -- an arbitrary one if there are multiple matching candidates, and
- -- don't worry about later instantiation
- --
- -- Example: constraint (Foo [b])
- -- instance {-# INCOHERENT -} Foo [Int]
- -- instance Foo [a]
- -- Without the Incoherent flag, we'd complain that
- -- instantiating 'b' would change which instance
- -- was chosen. See also Note [Incoherent instances] in "GHC.Core.InstEnv"
-
- | NonCanonical SourceText
- -- ^ Behave like Incoherent, but the instance choice is observable
- -- by the program behaviour. See Note [Coherence and specialisation: overview].
- --
- -- We don't have surface syntax for the distinction between
- -- Incoherent and NonCanonical instances; instead, the flag
- -- `-f{no-}specialise-incoherents` (on by default) controls
- -- whether `INCOHERENT` instances are regarded as Incoherent or
- -- NonCanonical.
-
- deriving (Eq, Data)
-
-
-instance Outputable OverlapFlag where
- ppr flag = ppr (overlapMode flag) <+> pprSafeOverlap (isSafeOverlap flag)
-
-instance NFData OverlapFlag where
- rnf (OverlapFlag mode safe) = rnf mode `seq` rnf safe
-
-instance Outputable OverlapMode where
- ppr (NoOverlap _) = empty
- ppr (Overlappable _) = text "[overlappable]"
- ppr (Overlapping _) = text "[overlapping]"
- ppr (Overlaps _) = text "[overlap ok]"
- ppr (Incoherent _) = text "[incoherent]"
- ppr (NonCanonical _) = text "[noncanonical]"
-
-instance NFData OverlapMode where
- rnf (NoOverlap s) = rnf s
- rnf (Overlappable s) = rnf s
- rnf (Overlapping s) = rnf s
- rnf (Overlaps s) = rnf s
- rnf (Incoherent s) = rnf s
- rnf (NonCanonical s) = rnf s
-
-instance Binary OverlapMode where
- put_ bh (NoOverlap s) = putByte bh 0 >> put_ bh s
- put_ bh (Overlaps s) = putByte bh 1 >> put_ bh s
- put_ bh (Incoherent s) = putByte bh 2 >> put_ bh s
- put_ bh (Overlapping s) = putByte bh 3 >> put_ bh s
- put_ bh (Overlappable s) = putByte bh 4 >> put_ bh s
- put_ bh (NonCanonical s) = putByte bh 5 >> put_ bh s
- get bh = do
- h <- getByte bh
- case h of
- 0 -> (get bh) >>= \s -> return $ NoOverlap s
- 1 -> (get bh) >>= \s -> return $ Overlaps s
- 2 -> (get bh) >>= \s -> return $ Incoherent s
- 3 -> (get bh) >>= \s -> return $ Overlapping s
- 4 -> (get bh) >>= \s -> return $ Overlappable s
- 5 -> (get bh) >>= \s -> return $ NonCanonical s
- _ -> panic ("get OverlapMode" ++ show h)
-
-
-instance Binary OverlapFlag where
- put_ bh flag = do put_ bh (overlapMode flag)
- put_ bh (isSafeOverlap flag)
- get bh = do
- h <- get bh
- b <- get bh
- return OverlapFlag { overlapMode = h, isSafeOverlap = b }
-
-pprSafeOverlap :: Bool -> SDoc
-pprSafeOverlap True = text "[safe]"
-pprSafeOverlap False = empty
-
{-
************************************************************************
* *
=====================================
compiler/GHC/Types/Name.hs
=====================================
@@ -105,10 +105,11 @@ import GHC.Utils.Outputable
import GHC.Utils.Panic
import GHC.OldList (intersperse)
+import Language.Haskell.Syntax.Basic (Boxity(Boxed, Unboxed))
+
import Control.DeepSeq
import Data.Data
import qualified Data.Semigroup as S
-import GHC.Types.Basic (Boxity(Boxed, Unboxed))
import GHC.Builtin.Uniques ( isTupleTyConUnique, isCTupleTyConUnique,
isSumTyConUnique, isTupleDataConLikeUnique )
=====================================
compiler/GHC/Unit/Types.hs
=====================================
@@ -99,7 +99,7 @@ import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BS.Char8
import Language.Haskell.Syntax.Module.Name
-import Language.Haskell.Syntax.ImpExp (IsBootInterface(..))
+import Language.Haskell.Syntax.ImpExp.IsBoot (IsBootInterface(..))
---------------------------------------------------------------------
-- MODULES
=====================================
compiler/GHC/Utils/Outputable.hs
=====================================
@@ -114,6 +114,7 @@ import {-# SOURCE #-} GHC.Types.Name.Occurrence( OccName )
import Language.Haskell.Syntax.Basic
import Language.Haskell.Syntax.Binds.InlinePragma
+import Language.Haskell.Syntax.Decls.Overlap ( OverlapMode(..) )
import Language.Haskell.Syntax.Module.Name ( ModuleName(..) )
import GHC.Prelude.Basic
@@ -2026,3 +2027,12 @@ instance Outputable RuleMatchInfo where
instance Outputable TopLevelFlag where
ppr TopLevel = text "<TopLevel>"
ppr NotTopLevel = text "<NotTopLevel>"
+
+instance Outputable (OverlapMode p) where
+ ppr (NoOverlap _) = empty
+ ppr (Overlappable _) = text "[overlappable]"
+ ppr (Overlapping _) = text "[overlapping]"
+ ppr (Overlaps _) = text "[overlap ok]"
+ ppr (Incoherent _) = text "[incoherent]"
+ ppr (NonCanonical _) = text "[noncanonical]"
+ ppr (XOverlapMode _) = text "[user TTG extension]"
=====================================
compiler/Language/Haskell/Syntax/Basic.hs
=====================================
@@ -1,6 +1,8 @@
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
+
module Language.Haskell.Syntax.Basic where
+import Control.DeepSeq
import Data.Data (Data)
import Data.Eq
import Data.Ord
@@ -8,7 +10,6 @@ import Data.Bool
import Prelude
import GHC.Data.FastString (FastString)
-import Control.DeepSeq
{-
************************************************************************
=====================================
compiler/Language/Haskell/Syntax/Decls.hs
=====================================
@@ -88,18 +88,18 @@ module Language.Haskell.Syntax.Decls (
-- friends:
import {-# SOURCE #-} Language.Haskell.Syntax.Expr
- ( HsExpr, HsUntypedSplice )
+ (HsExpr, HsUntypedSplice)
-- Because Expr imports Decls via HsBracket
-import Language.Haskell.Syntax.Basic (TopLevelFlag, RuleName)
+import Language.Haskell.Syntax.Basic
+ (LexicalFixity, Role, RuleName, TopLevelFlag)
import Language.Haskell.Syntax.Binds
import Language.Haskell.Syntax.Binds.InlinePragma (Activation)
+import Language.Haskell.Syntax.Decls.Overlap (OverlapMode)
import Language.Haskell.Syntax.Extension
-import Language.Haskell.Syntax.Type
-import Language.Haskell.Syntax.Basic (Role, LexicalFixity)
import Language.Haskell.Syntax.Specificity (Specificity)
+import Language.Haskell.Syntax.Type
-import GHC.Types.Basic (OverlapMode)
import GHC.Types.ForeignCall (CType, CCallConv, Safety, Header, CLabelString, CCallTarget, CExportSpec)
import GHC.Data.FastString (FastString)
@@ -119,7 +119,7 @@ import Prelude (Show)
import Data.Foldable
import Data.Traversable
import Data.List.NonEmpty (NonEmpty (..))
-import GHC.Generics ( Generic )
+import GHC.Generics (Generic)
{-
@@ -1261,7 +1261,7 @@ data ClsInstDecl pass
, cid_sigs :: [LSig pass] -- User-supplied pragmatic info
, cid_tyfam_insts :: [LTyFamInstDecl pass] -- Type family instances
, cid_datafam_insts :: [LDataFamInstDecl pass] -- Data family instances
- , cid_overlap_mode :: Maybe (XRec pass OverlapMode)
+ , cid_overlap_mode :: Maybe (XRec pass (OverlapMode pass))
}
| XClsInstDecl !(XXClsInstDecl pass)
@@ -1310,7 +1310,7 @@ data DerivDecl pass = DerivDecl
-- See Note [Inferring the instance context] in GHC.Tc.Deriv.Infer.
, deriv_strategy :: Maybe (LDerivStrategy pass)
- , deriv_overlap_mode :: Maybe (XRec pass OverlapMode)
+ , deriv_overlap_mode :: Maybe (XRec pass (OverlapMode pass))
}
| XDerivDecl !(XXDerivDecl pass)
=====================================
compiler/Language/Haskell/Syntax/Decls/Overlap.hs
=====================================
@@ -0,0 +1,123 @@
+{-# LANGUAGE GeneralisedNewtypeDeriving #-}
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE OverlappingInstances #-}
+{-# LANGUAGE UndecidableInstances #-} -- Eq XOverlapMode, NFData OverlapMode
+
+{- |
+Data-type describing the overlap annotations for instances.
+-}
+module Language.Haskell.Syntax.Decls.Overlap where
+
+import Control.DeepSeq
+import Data.Eq
+import Prelude
+
+import Language.Haskell.Syntax.Extension
+
+-- | The status of overlapping instances /(including no overlap)/ for a type.
+data OverlapMode pass -- See Note [Rules for instance lookup] in GHC.Core.InstEnv
+ = NoOverlap (XOverlapMode pass)
+ -- ^ This instance must not overlap another `NoOverlap` instance.
+ -- However, it may be overlapped by `Overlapping` instances,
+ -- and it may overlap `Overlappable` instances.
+
+
+ | Overlappable (XOverlapMode pass)
+ -- ^ Silently ignore this instance if you find a
+ -- more specific one that matches the constraint
+ -- you are trying to resolve
+ --
+ -- Example: constraint (Foo [Int])
+ -- instance Foo [Int]
+ -- instance {-# OVERLAPPABLE #-} Foo [a]
+ --
+ -- Since the second instance has the Overlappable flag,
+ -- the first instance will be chosen (otherwise
+ -- its ambiguous which to choose)
+
+ | Overlapping (XOverlapMode pass)
+ -- ^ Silently ignore any more general instances that may be
+ -- used to solve the constraint.
+ --
+ -- Example: constraint (Foo [Int])
+ -- instance {-# OVERLAPPING #-} Foo [Int]
+ -- instance Foo [a]
+ --
+ -- Since the first instance has the Overlapping flag,
+ -- the second---more general---instance will be ignored (otherwise
+ -- it is ambiguous which to choose)
+
+ | Overlaps (XOverlapMode pass)
+ -- ^ Equivalent to having both `Overlapping` and `Overlappable` flags.
+
+ | Incoherent (XOverlapMode pass)
+ -- ^ Behave like Overlappable and Overlapping, and in addition pick
+ -- an arbitrary one if there are multiple matching candidates, and
+ -- don't worry about later instantiation
+ --
+ -- Example: constraint (Foo [b])
+ -- instance {-# INCOHERENT -} Foo [Int]
+ -- instance Foo [a]
+ -- Without the Incoherent flag, we'd complain that
+ -- instantiating 'b' would change which instance
+ -- was chosen. See also Note [Incoherent instances] in "GHC.Core.InstEnv"
+
+ | NonCanonical (XOverlapMode pass)
+ -- ^ Behave like Incoherent, but the instance choice is observable
+ -- by the program behaviour. See Note [Coherence and specialisation: overview].
+ --
+ -- We don't have surface syntax for the distinction between
+ -- Incoherent and NonCanonical instances; instead, the flag
+ -- `-f{no-}specialise-incoherents` (on by default) controls
+ -- whether `INCOHERENT` instances are regarded as Incoherent or
+ -- NonCanonical.
+
+ | XOverlapMode !(XXOverlapMode pass)
+ -- ^ The /Trees That Grow/ extension point constructor.
+
+deriving instance ( Eq (XOverlapMode pass)
+ , Eq (XXOverlapMode pass)
+ ) => Eq (OverlapMode pass)
+
+instance ( NFData (XOverlapMode pass)
+ , NFData (XXOverlapMode pass)
+ ) => NFData (OverlapMode pass) where
+ rnf = \case
+ NoOverlap s -> rnf s
+ Overlappable s -> rnf s
+ Overlapping s -> rnf s
+ Overlaps s -> rnf s
+ Incoherent s -> rnf s
+ NonCanonical s -> rnf s
+ XOverlapMode s -> rnf s
+
+
+hasIncoherentFlag :: OverlapMode p -> Bool
+hasIncoherentFlag mode =
+ case mode of
+ Incoherent _ -> True
+ NonCanonical _ -> True
+ _ -> False
+
+hasOverlappableFlag :: OverlapMode p -> Bool
+hasOverlappableFlag mode =
+ case mode of
+ Overlappable _ -> True
+ Overlaps _ -> True
+ Incoherent _ -> True
+ NonCanonical _ -> True
+ _ -> False
+
+hasOverlappingFlag :: OverlapMode p -> Bool
+hasOverlappingFlag mode =
+ case mode of
+ Overlapping _ -> True
+ Overlaps _ -> True
+ Incoherent _ -> True
+ NonCanonical _ -> True
+ _ -> False
+
+hasNonCanonicalFlag :: OverlapMode p -> Bool
+hasNonCanonicalFlag = \case
+ NonCanonical{} -> True
+ _ -> False
=====================================
compiler/Language/Haskell/Syntax/Extension.hs
=====================================
@@ -359,6 +359,11 @@ type family XDataFamInstD x
type family XTyFamInstD x
type family XXInstDecl x
+-- -------------------------------------
+-- OverlapMode type families
+type family XOverlapMode x
+type family XXOverlapMode x
+
-- -------------------------------------
-- DerivDecl type families
type family XCDerivDecl x
=====================================
compiler/ghc.cabal.in
=====================================
@@ -546,6 +546,7 @@ Library
GHC.Hs.Basic
GHC.Hs.Binds
GHC.Hs.Decls
+ GHC.Hs.Decls.Overlap
GHC.Hs.Doc
GHC.Hs.DocString
GHC.Hs.Dump
@@ -1024,6 +1025,7 @@ Library
Language.Haskell.Syntax.Binds.InlinePragma
Language.Haskell.Syntax.BooleanFormula
Language.Haskell.Syntax.Decls
+ Language.Haskell.Syntax.Decls.Overlap
Language.Haskell.Syntax.Expr
Language.Haskell.Syntax.Extension
Language.Haskell.Syntax.ImpExp
=====================================
utils/check-exact/ExactPrint.hs
=====================================
@@ -45,8 +45,8 @@ import GHC.Base (NonEmpty(..))
import qualified GHC.Data.BooleanFormula as BF
import GHC.Data.FastString
import qualified GHC.Data.Strict as Strict
+import GHC.Hs.Decls.Overlap (OverlapMode(..))
import GHC.TypeLits
-import GHC.Types.Basic hiding (EP)
import GHC.Types.ForeignCall
import GHC.Types.InlinePragma (ActivationGhc, inlinePragmaActivation, inlinePragmaSource)
import GHC.Types.Name.Reader
@@ -2263,7 +2263,7 @@ instance ExactPrint (TyFamInstDecl GhcPs) where
-- ---------------------------------------------------------------------
-instance ExactPrint (LocatedP OverlapMode) where
+instance Typeable p => ExactPrint (LocatedP (OverlapMode (GhcPass p))) where
getAnnotationEntry = entryFromLocatedA
setAnnotationAnchor = setAnchorAn
=====================================
utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
=====================================
@@ -37,6 +37,7 @@ import GHC hiding (NoLink, HsTypeGhcPsExt (..))
import GHC.Builtin.Types (eqTyCon_RDR, tupleDataConName, tupleTyConName)
import GHC.Core.TyCon (tyConResKind)
import GHC.Driver.DynFlags (getDynFlags)
+import GHC.Hs.Decls.Overlap (OverlapMode(..))
import GHC.Types.Basic (TupleSort (..))
import GHC.Types.Name
import GHC.Types.Name.Reader (RdrName (Exact))
@@ -860,10 +861,19 @@ renameDerivD
{ deriv_ext = noExtField
, deriv_type = ty'
, deriv_strategy = strat'
- , deriv_overlap_mode = omode
+ , deriv_overlap_mode = fmap convertOverlapMode <$> omode
}
)
+convertOverlapMode :: OverlapMode GhcRn -> OverlapMode DocNameI
+convertOverlapMode = \case
+ NoOverlap _ -> NoOverlap NoExtField
+ Overlappable _ -> Overlappable NoExtField
+ Overlapping _ -> Overlapping NoExtField
+ Overlaps _ -> Overlaps NoExtField
+ Incoherent _ -> Incoherent NoExtField
+ NonCanonical _ -> NonCanonical NoExtField
+
renameDerivStrategy :: DerivStrategy GhcRn -> RnM (DerivStrategy DocNameI)
renameDerivStrategy (StockStrategy a) = pure (StockStrategy a)
renameDerivStrategy (AnyclassStrategy a) = pure (AnyclassStrategy a)
@@ -885,7 +895,7 @@ renameClsInstD
return
( ClsInstDecl
{ cid_ext = noExtField
- , cid_overlap_mode = omode
+ , cid_overlap_mode = fmap convertOverlapMode <$> omode
, cid_poly_ty = ltype'
, cid_binds = []
, cid_sigs = []
=====================================
utils/haddock/haddock-api/src/Haddock/Types.hs
=====================================
@@ -56,6 +56,7 @@ import GHC.Data.BooleanFormula (BooleanFormula)
import GHC.Driver.Session (Language)
import qualified GHC.LanguageExtensions as LangExt
import GHC.Core.InstEnv (is_dfun_name)
+import GHC.Hs.Decls.Overlap (OverlapMode)
import GHC.Types.Name (stableNameCmp)
import GHC.Types.Name.Occurrence
import GHC.Types.Name.Reader (RdrName (..))
@@ -829,6 +830,7 @@ type instance Anno (FamilyResultSig DocNameI) = EpAnn NoEpAnns
type instance Anno (HsOuterTyVarBndrs Specificity DocNameI) = SrcSpanAnnA
type instance Anno (HsSigType DocNameI) = SrcSpanAnnA
type instance Anno (BooleanFormula DocNameI) = SrcSpanAnnL
+type instance Anno (OverlapMode DocNameI) = EpAnn AnnPragma
type XRecCond a =
( XParTy a ~ (EpToken "(", EpToken ")")
@@ -960,8 +962,10 @@ type instance XClassDecl DocNameI = NoExtField
type instance XDataDecl DocNameI = NoExtField
type instance XSynDecl DocNameI = NoExtField
type instance XFamDecl DocNameI = NoExtField
+type instance XOverlapMode DocNameI = NoExtField
type instance XXHsDataDefn DocNameI = DataConCantHappen
type instance XXFamilyDecl DocNameI = DataConCantHappen
+type instance XXOverlapMode DocNameI = DataConCantHappen
type instance XXTyClDecl DocNameI = DataConCantHappen
type instance XHsWC DocNameI _ = NoExtField
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/76bbbe232482d9808d6c83185f50b16…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/76bbbe232482d9808d6c83185f50b16…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/jeltsch/stability-risk-1-and-2-module-deprecation] Amend error output of `T21336`
by Wolfgang Jeltsch (@jeltsch) 29 Jan '26
by Wolfgang Jeltsch (@jeltsch) 29 Jan '26
29 Jan '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/stability-risk-1-and-2-module-deprecation at Glasgow Haskell Compiler / GHC
Commits:
c7493f8e by Wolfgang Jeltsch at 2026-01-29T22:52:27+02:00
Amend error output of `T21336`
- - - - -
2 changed files:
- libraries/base/tests/IO/T21336/T21336b.stderr
- + libraries/base/tests/IO/T21336/T21336c.stderr
Changes:
=====================================
libraries/base/tests/IO/T21336/T21336b.stderr
=====================================
@@ -1 +1,5 @@
+FinalizerExceptionHandler.hs:7:1: warning: [GHC-15328] [-Wdeprecations (in -Wextended-warnings)]
+ Module ‘GHC.Exception’ is deprecated:
+ "GHC.Exception is deprecated and will be removed in GHC 10.02. Please use Control.Exception where possible and the ghc-internal package otherwise."
+
Exception during weak pointer finalization (ignored): <stdout>: hFlush: resource exhausted (No space left on device)
=====================================
libraries/base/tests/IO/T21336/T21336c.stderr
=====================================
@@ -0,0 +1,3 @@
+FinalizerExceptionHandler.hs:7:1: warning: [GHC-15328] [-Wdeprecations (in -Wextended-warnings)]
+ Module ‘GHC.Exception’ is deprecated:
+ "GHC.Exception is deprecated and will be removed in GHC 10.02. Please use Control.Exception where possible and the ghc-internal package otherwise."
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c7493f8e63444d07166f66f5a41c050…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c7493f8e63444d07166f66f5a41c050…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26699] 19 commits: ci: remove duplicate keys in .gitlab-ci.yml
by recursion-ninja (@recursion-ninja) 29 Jan '26
by recursion-ninja (@recursion-ninja) 29 Jan '26
29 Jan '26
recursion-ninja pushed to branch wip/26699 at Glasgow Haskell Compiler / GHC
Commits:
414b9593 by Cheng Shao at 2026-01-24T07:11:51-05:00
ci: remove duplicate keys in .gitlab-ci.yml
This patch removes accidentally duplicate keys in `.gitlab-ci.yml`.
The YAML spec doesn't allow duplicate keys in the first place, and
according to GitLab docs
(https://docs.gitlab.com/ci/yaml/yaml_optimization/#anchors) the
latest key overrides the earlier entries.
- - - - -
e5cb5491 by Cheng Shao at 2026-01-24T07:12:34-05:00
hadrian: drop obsolete configure/make builder logic for libffi
This patch drops obsolete hadrian logic around `Configure
libffiPath`/`Make libffiPath` builders, they are no longer needed
after libffi-clib has landed. Closes #26815.
- - - - -
2d160222 by Simon Hengel at 2026-01-24T07:13:17-05:00
Fix typo in roles.rst
- - - - -
56db94f7 by Peter Trommler at 2026-01-26T11:26:18+01:00
PPC NCG: Generate clear right insn at arch width
The clear right immediate (clrrxi) is only available in word and
doubleword width. Generate clrrxi instructions at architecture
width for all MachOp widths.
Fixes #24145
- - - - -
5957a8ad by Wolfgang Jeltsch at 2026-01-27T06:11:40-05:00
Add operations for obtaining operating-system handles
This contribution implements CLC proposal #369. It adds operations for
obtaining POSIX file descriptors and Windows handles that underlie
Haskell handles. Those operating system handles can also be obtained
without such additional operations, but this is more involved and, more
importantly, requires using internals.
- - - - -
86a0510c by Greg Steuck at 2026-01-27T06:12:34-05:00
Move flags to precede patterns for grep and read files directly
This makes the tests pass with non-GNU (i.e. POSIX-complicant) tools.
There's no reason to use cat and pipe where direct file argument works.
- - - - -
50761451 by Cheng Shao at 2026-01-27T21:51:23-05:00
ci: update darwin boot ghc to 9.10.3
This patch updates darwin boot ghc to 9.10.3, along with other related
updates, and pays off some technical debt here:
- Update `nixpkgs` and use the `nixpkgs-25.05-darwin` channel.
- Update the `niv` template.
- Update LLVM to 21 and update `llvm-targets` to reflect LLVM 21
layout changes for arm64/x86_64 darwin targets.
- Use `stdenvNoCC` to prevent nix packaged apple sdk from being used
by boot ghc, and manually set `DEVELOPER_DIR`/`SDKROOT` to enforce
the usage of system-wide command line sdk for macos.
- When building nix derivation for boot ghc, run `configure` via the
`arch` command so that `configure` and its subprocesses pick up the
manually specified architecture.
- Remove the previous horrible hack that obliterates `configure` to
make autoconf test result in true. `configure` now properly does its
job.
- Remove the now obsolete configure args and post install settings
file patching logic.
- Use `scheme-small` for texlive to avoid build failures in certain
unused texlive packages, especially on x86_64-darwin.
- - - - -
94dcd15e by Matthew Pickering at 2026-01-27T21:52:05-05:00
Evaluate backtraces for "error" exceptions at the moment they are thrown
See Note [Capturing the backtrace in throw] and
Note [Hiding precise exception signature in throw] which explain the
implementation.
This commit makes `error` and `throw` behave the same with regard to
backtraces. Previously, exceptions raised by `error` would not contain
useful IPE backtraces.
I did try and implement `error` in terms of `throw` but it started to
involve putting diverging functions into hs-boot files, which seemed to
risky if the compiler wouldn't be able to see if applying a function
would diverge.
CLC proposal: https://github.com/haskell/core-libraries-committee/issues/383
Fixes #26751
- - - - -
ef35e3ea by Teo Camarasu at 2026-01-27T21:52:46-05:00
ghc-internal: move all Data instances to Data.Data
Most instances of Data are defined in GHC.Internal.Data.Data.
Let's move all remaining instance there.
This moves other modules down in the dependency hierarchy allowing for
more parallelism, and it decreases the likelihood that we would need to
load this heavy .hi file if we don't actually need it.
Resolves #26830
Metric Decrease:
T12227
T16875
- - - - -
5e0ec555 by sheaf at 2026-01-28T06:56:38-05:00
Add test case for #25679
This commit adds the T25679 test case. The test now passes, thanks to
commit 1e53277af36d3f0b6ad5491f70ffc5593a49dcfd.
Fixes #25679
- - - - -
f1cd1611 by sheaf at 2026-01-28T06:56:38-05:00
Improve defaulting of representational equalities
This commit makes the defaulting of representational equalities, introduced
in 1e53277a, a little bit more robust. Now, instead of calling the eager
unifier, it calls the full-blown constraint solver, which means that it can
handle some subtle situations, e.g. involving functional dependencies and
type-family injectivity annotations, such as:
type family F a = r | r -> a
type instance F Int = Bool
[W] F beta ~R Bool
- - - - -
25edf516 by sheaf at 2026-01-28T06:56:38-05:00
Improve errors for unsolved representational equalities
This commit adds a new field of CtLoc, CtExplanations, which allows the
typechecker to leave some information about what it has done. For the moment,
it is only used to improve error messages for unsolved representational
equalities. The typechecker will now accumulate, when unifying at
representational role:
- out-of-scope newtype constructors,
- type constructors that have nominal role in a certain argument,
- over-saturated type constructors,
- AppTys, e.g. `c a ~R# c b`, to report that we must assume that 'c' has
nominal role in its parameters,
- data family applications that do not reduce, potentially preventing
newtype unwrapping.
Now, instead of having to re-construct the possible errors after the fact,
we simply consult the CtExplanations field.
Additionally, this commit modifies the typechecker error messages that
concern out-of-scope newtype constructors. The error message now depends
on whether we have an import suggestion to provide to the user:
- If we have an import suggestion for the newtype constructor,
the message will be of the form:
The data constructor MkN of the newtype N is out of scope
Suggested fix: add 'MkN' to the import list in the import of 'M'
- If we don't have any import suggestions, the message will be
of the form:
NB: The type 'N' is an opaque newtype, whose constructor is hidden
Fixes #15850, #20289, #20468, #23731, #25949, #26137
- - - - -
4d0e6da1 by Simon Peyton Jones at 2026-01-28T06:57:19-05:00
Fix two bugs in short-cut constraint solving
There are two main changes here:
* Use `isSolvedWC` rather than `isEmptyWC` in `tryShortCutSolver`
The residual constraint may have some fully-solved, but
still-there implications, and we don't want them to abort short
cut solving! That bug caused #26805.
* In the short-cut solver, we abandon the fully-solved residual
constraint; but we may thereby lose track of Givens that are
needed, and either report them as redundant or prune evidence
bindings that are in fact needed.
This bug stopped the `constraints` package from compiling;
see the trail in !15389.
The second bug led me to (another) significant refactoring
of the mechanism for tracking needed EvIds. See the new
Note [Tracking needed EvIds] in GHC.Tc.Solver.Solve
It's simpler and much less head-scratchy now.
Some particulars:
* An EvBindsVar now tracks NeededEvIds
* We deal with NeededEvIds for an implication only when it is
fully solved. Much simpler!
* `tryShortCutTcS` now takes a `TcM WantedConstraints` rather than
`TcM Bool`, so that is can plumb the needed EvIds correctly.
* Remove `ic_need` and `ic_need_implic` from Implication (hooray),
and add `ics_dm` and `ics_non_dm` to `IC_Solved`.
Pure refactor
* Shorten data constructor `CoercionHole` to `CH`, following
general practice in GHC.
* Rename `EvBindMap` to `EvBindsMap` for consistency
- - - - -
662480b7 by Cheng Shao at 2026-01-28T06:58:00-05:00
ci: use debian validate bindists instead of fedora release bindists in testing stage
This patch changes the `abi-test`, `hadrian-multi` and `perf` jobs in
the full-ci pipeline testing stage to use debian validate bindists
instead of fedora release bindists, to increase pipeline level
parallelism and allow full-ci pipelines to complete earlier. Closes #26818.
- - - - -
39581ec6 by Cheng Shao at 2026-01-28T06:58:40-05:00
ci: run perf test with -j$cores
This patch makes the perf ci job compile Cabal with -j$cores to speed
up the job.
- - - - -
607b287b by Wolfgang Jeltsch at 2026-01-28T15:41:53+02:00
Remove `GHC.Desugar` from `base`
`GHC.Desugar` was deprecated and should have been removed in GHC 9.14.
However, the removal was forgotten, although there was a code block that
was intended to trigger a compilation error when the GHC version in use
was 9.14 or later. This code sadly didn’t work, because the
`__GLASGOW_HASKELL__` macro was misspelled as `__GLASGOW_HASKELL`.
- - - - -
e8f5a45d by sterni at 2026-01-29T04:19:18-05:00
users_guide: fix runtime error during build with Sphinx 9.1.0
Appears that pathto is stricter about what it accepts now.
Tested Sphinx 8.2.3 and 9.1.0 on the ghc-9.10 branch.
Resolves #26810.
Co-authored-by: Martin Weinelt <hexa(a)darmstadt.ccc.de>
- - - - -
8957432a by Recursion Ninja at 2026-01-29T14:20:53-05:00
Migrating the simplest types required for Trees That Grow progress
from GHC.Types.Basic to Language.Haskell.Syntax.Basic. Related
function definitions were also moved. Outputable type-class instances
are defined in GHC.Utils.Outputable. Binary instance of Boxity was
moved to GHC.Utils.Binary.
Migrated types:
* TopLevelFlag
* RuleName
* TyConFlavour
* TypeOrData
* NewOrData
- - - - -
c2ddef60 by Recursion Ninja at 2026-01-29T14:51:34-05:00
Add TTG extension point to 'OverlapMode'
Migrate OverlapMode to new module Language.Haskell.Syntax.Overlap
Migrate OverlapFlag to new module GHC.Hs.Decls.Overlap
- - - - -
172 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/darwin/nix/sources.json
- .gitlab/darwin/toolchain.nix
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCo/Tidy.hs
- compiler/GHC/Core/TyCon/RecWalk.hs
- compiler/GHC/Data/Maybe.hs
- compiler/GHC/Hs/Decls.hs
- + compiler/GHC/Hs/Decls/Overlap.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Parser.y
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/CtLoc.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Name.hs
- compiler/GHC/Types/RepType.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Monad.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/GHC/Utils/Trace.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- + compiler/Language/Haskell/Syntax/Decls/Overlap.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/ghc.cabal.in
- docs/users_guide/exts/roles.rst
- docs/users_guide/rtd-theme/layout.html
- hadrian/src/Context.hs
- hadrian/src/Settings/Builders/Configure.hs
- hadrian/src/Settings/Builders/Make.hs
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- − libraries/base/src/GHC/Desugar.hs
- + libraries/base/src/System/IO/OS.hs
- libraries/base/tests/IO/all.T
- + libraries/base/tests/IO/osHandles001FileDescriptors.hs
- + libraries/base/tests/IO/osHandles001FileDescriptors.stdout
- + libraries/base/tests/IO/osHandles001WindowsHandles.hs
- + libraries/base/tests/IO/osHandles001WindowsHandles.stdout
- + libraries/base/tests/IO/osHandles002FileDescriptors.hs
- + libraries/base/tests/IO/osHandles002FileDescriptors.stderr
- + libraries/base/tests/IO/osHandles002FileDescriptors.stdin
- + libraries/base/tests/IO/osHandles002FileDescriptors.stdout
- + libraries/base/tests/IO/osHandles002WindowsHandles.hs
- + libraries/base/tests/IO/osHandles002WindowsHandles.stderr
- + libraries/base/tests/IO/osHandles002WindowsHandles.stdin
- + libraries/base/tests/IO/osHandles002WindowsHandles.stdout
- libraries/base/tests/T23454.stderr
- libraries/base/tests/perf/Makefile
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Data/Data.hs
- libraries/ghc-internal/src/GHC/Internal/Err.hs
- libraries/ghc-internal/src/GHC/Internal/Exts.hs
- libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
- + libraries/ghc-internal/src/GHC/Internal/System/IO/OS.hs
- libraries/ghc-internal/tests/stack-annotation/all.T
- + libraries/ghc-internal/tests/stack-annotation/ann_frame005.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame005.stdout
- llvm-targets
- + testsuite/tests/default/T25825.hs
- testsuite/tests/default/all.T
- testsuite/tests/deriving/should_fail/T1496.stderr
- testsuite/tests/deriving/should_fail/T4846.stderr
- testsuite/tests/deriving/should_fail/T5498.stderr
- testsuite/tests/deriving/should_fail/T6147.stderr
- testsuite/tests/deriving/should_fail/T7148.stderr
- testsuite/tests/deriving/should_fail/T7148a.stderr
- testsuite/tests/deriving/should_fail/T8984.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail5.stderr
- testsuite/tests/driver/T16318/Makefile
- testsuite/tests/driver/T18125/Makefile
- testsuite/tests/gadt/CasePrune.stderr
- testsuite/tests/ghci.debugger/scripts/T8487.stdout
- testsuite/tests/ghci.debugger/scripts/break011.stdout
- testsuite/tests/ghci.debugger/scripts/break017.stdout
- testsuite/tests/ghci.debugger/scripts/break025.stdout
- testsuite/tests/indexed-types/should_fail/T9580.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- testsuite/tests/linear/should_fail/LinearRole.stderr
- testsuite/tests/roles/should_fail/RolesIArray.stderr
- + testsuite/tests/simplCore/should_compile/T26805.hs
- + testsuite/tests/simplCore/should_compile/T26805.stderr
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/typecheck/should_compile/T26805a.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T10285.stderr
- testsuite/tests/typecheck/should_fail/T10534.stderr
- testsuite/tests/typecheck/should_fail/T10715b.stderr
- testsuite/tests/typecheck/should_fail/T11347.stderr
- testsuite/tests/typecheck/should_fail/T15801.stderr
- + testsuite/tests/typecheck/should_fail/T15850.hs
- + testsuite/tests/typecheck/should_fail/T15850.stderr
- + testsuite/tests/typecheck/should_fail/T15850_Lib.hs
- + testsuite/tests/typecheck/should_fail/T20289.hs
- + testsuite/tests/typecheck/should_fail/T20289.stderr
- + testsuite/tests/typecheck/should_fail/T20289_A.hs
- testsuite/tests/typecheck/should_fail/T22645.stderr
- testsuite/tests/typecheck/should_fail/T22924a.stderr
- + testsuite/tests/typecheck/should_fail/T23731.hs
- + testsuite/tests/typecheck/should_fail/T23731.stderr
- + testsuite/tests/typecheck/should_fail/T23731b.hs
- + testsuite/tests/typecheck/should_fail/T23731b.stderr
- + testsuite/tests/typecheck/should_fail/T23731b_aux.hs
- + testsuite/tests/typecheck/should_fail/T25679.hs
- + testsuite/tests/typecheck/should_fail/T25679.stderr
- + testsuite/tests/typecheck/should_fail/T25949.hs
- + testsuite/tests/typecheck/should_fail/T25949.stderr
- + testsuite/tests/typecheck/should_fail/T25949_aux.hs
- + testsuite/tests/typecheck/should_fail/T26137.hs
- + testsuite/tests/typecheck/should_fail/T26137.stderr
- testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
- testsuite/tests/typecheck/should_fail/TcCoercibleFail3.stderr
- testsuite/tests/typecheck/should_fail/all.T
- utils/check-exact/ExactPrint.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ebe1815552f2d5edf28b0fd06140c0…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ebe1815552f2d5edf28b0fd06140c0…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
29 Jan '26
Andreas Klebinger pushed to branch wip/andreask/linker_fix at Glasgow Haskell Compiler / GHC
Commits:
63a67b8f by Andreas Klebinger at 2026-01-29T20:27:16+01:00
wibbles
- - - - -
1 changed file:
- rts/linker/MachO.c
Changes:
=====================================
rts/linker/MachO.c
=====================================
@@ -175,7 +175,7 @@ resolveImports(
int
ocAllocateExtras_MachO(ObjectCode* oc)
{
- IF_DEBUG(linker, DEBUG_LOG_ALWAYS("ocAllocateExtras_MachO: start\n"));
+ IF_DEBUG(linker, DEBUG_LOG("ocAllocateExtras_MachO: start\n"));
if (NULL != oc->info->symCmd) {
IF_DEBUG(linker,
@@ -200,7 +200,7 @@ int
ocVerifyImage_MachO(ObjectCode * oc)
{
char *image = (char*) oc->image;
- if (oc->fileSize < sizeof(MachOHeader)) {
+ if (oc->fileSize < (int) sizeof(MachOHeader)) {
errorBelch("Tried loading machO smaller than header size.\n");
return 0;
}
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/63a67b8fac35cc4be5519fb16f5f9f7…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/63a67b8fac35cc4be5519fb16f5f9f7…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: users_guide: fix runtime error during build with Sphinx 9.1.0
by Marge Bot (@marge-bot) 29 Jan '26
by Marge Bot (@marge-bot) 29 Jan '26
29 Jan '26
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
e8f5a45d by sterni at 2026-01-29T04:19:18-05:00
users_guide: fix runtime error during build with Sphinx 9.1.0
Appears that pathto is stricter about what it accepts now.
Tested Sphinx 8.2.3 and 9.1.0 on the ghc-9.10 branch.
Resolves #26810.
Co-authored-by: Martin Weinelt <hexa(a)darmstadt.ccc.de>
- - - - -
afa10261 by Jessica Clarke at 2026-01-29T11:58:13-05:00
PPC NCG: Use libcall for 64-bit cmpxchg on 32-bit PowerPC
There is no native instruction for this, and even if there were a
register pair version we could use, the implementation here is assuming
the values fit in a single register, and we end up only using / defining
the low halves of the registers.
Fixes: b4d39adbb5 ("PrimOps: Add CAS op for all int sizes")
Fixes: #23969
- - - - -
347d1141 by Michael Karcher at 2026-01-29T11:58:20-05:00
NCG for PPC: add pattern for CmmRegOff to iselExpr64
Closes #26828
- - - - -
2 changed files:
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- docs/users_guide/rtd-theme/layout.html
Changes:
=====================================
compiler/GHC/CmmToAsm/PPC/CodeGen.hs
=====================================
@@ -180,7 +180,7 @@ stmtToInstrs stmt = do
format = cmmTypeFormat ty
CmmUnsafeForeignCall target result_regs args
- -> genCCall target result_regs args
+ -> genCCall platform target result_regs args
CmmBranch id -> genBranch id
CmmCondBranch arg true false prediction -> do
@@ -338,6 +338,8 @@ iselExpr64 (CmmReg (CmmLocal local_reg)) = do
let Reg64 hi lo = localReg64 local_reg
return (RegCode64 nilOL hi lo)
+iselExpr64 regoff@(CmmRegOff _ _) = iselExpr64 $ mangleIndexTree regoff
+
iselExpr64 (CmmLit (CmmInt i _)) = do
Reg64 rhi rlo <- getNewReg64
let
@@ -1183,24 +1185,25 @@ genCondJump id bool prediction = do
-- @get_arg@, which moves the arguments to the correct registers/stack
-- locations. Apart from that, the code is easy.
-genCCall :: ForeignTarget -- function to call
+genCCall :: Platform
+ -> ForeignTarget -- function to call
-> [CmmFormal] -- where to put the result
-> [CmmActual] -- arguments (of mixed type)
-> NatM InstrBlock
-genCCall (PrimTarget MO_AcquireFence) _ _
+genCCall _ (PrimTarget MO_AcquireFence) _ _
= return $ unitOL LWSYNC
-genCCall (PrimTarget MO_ReleaseFence) _ _
+genCCall _ (PrimTarget MO_ReleaseFence) _ _
= return $ unitOL LWSYNC
-genCCall (PrimTarget MO_SeqCstFence) _ _
+genCCall _ (PrimTarget MO_SeqCstFence) _ _
= return $ unitOL HWSYNC
-genCCall (PrimTarget MO_Touch) _ _
+genCCall _ (PrimTarget MO_Touch) _ _
= return $ nilOL
-genCCall (PrimTarget (MO_Prefetch_Data _)) _ _
+genCCall _ (PrimTarget (MO_Prefetch_Data _)) _ _
= return $ nilOL
-genCCall (PrimTarget (MO_AtomicRMW width amop)) [dst] [addr, n]
+genCCall _ (PrimTarget (MO_AtomicRMW width amop)) [dst] [addr, n]
= do let fmt = intFormat width
reg_dst = getLocalRegReg dst
(instr, n_code) <- case amop of
@@ -1250,7 +1253,7 @@ genCCall (PrimTarget (MO_AtomicRMW width amop)) [dst] [addr, n]
(n_reg, n_code) <- getSomeReg n
return (op dst dst (RIReg n_reg), n_code)
-genCCall (PrimTarget (MO_AtomicRead width _)) [dst] [addr]
+genCCall _ (PrimTarget (MO_AtomicRead width _)) [dst] [addr]
= do let fmt = intFormat width
reg_dst = getLocalRegReg dst
form = if widthInBits width == 64 then DS else D
@@ -1277,12 +1280,12 @@ genCCall (PrimTarget (MO_AtomicRead width _)) [dst] [addr]
-- This is also what gcc does.
-genCCall (PrimTarget (MO_AtomicWrite width _)) [] [addr, val] = do
+genCCall _ (PrimTarget (MO_AtomicWrite width _)) [] [addr, val] = do
code <- assignMem_IntCode (intFormat width) addr val
return $ unitOL HWSYNC `appOL` code
-genCCall (PrimTarget (MO_Cmpxchg width)) [dst] [addr, old, new]
- | width == W32 || width == W64
+genCCall platform (PrimTarget (MO_Cmpxchg width)) [dst] [addr, old, new]
+ | width == W32 || (width == W64 && not (target32Bit platform))
= do
(old_reg, old_code) <- getSomeReg old
(new_reg, new_code) <- getSomeReg new
@@ -1311,9 +1314,8 @@ genCCall (PrimTarget (MO_Cmpxchg width)) [dst] [addr, old, new]
format = intFormat width
-genCCall (PrimTarget (MO_Clz width)) [dst] [src]
- = do platform <- getPlatform
- let reg_dst = getLocalRegReg dst
+genCCall platform (PrimTarget (MO_Clz width)) [dst] [src]
+ = do let reg_dst = getLocalRegReg dst
if target32Bit platform && width == W64
then do
RegCode64 code vr_hi vr_lo <- iselExpr64 src
@@ -1361,9 +1363,8 @@ genCCall (PrimTarget (MO_Clz width)) [dst] [src]
let cntlz = unitOL (CNTLZ format reg_dst reg)
return $ s_code `appOL` pre `appOL` cntlz `appOL` post
-genCCall (PrimTarget (MO_Ctz width)) [dst] [src]
- = do platform <- getPlatform
- let reg_dst = getLocalRegReg dst
+genCCall platform (PrimTarget (MO_Ctz width)) [dst] [src]
+ = do let reg_dst = getLocalRegReg dst
if target32Bit platform && width == W64
then do
let format = II32
@@ -1425,9 +1426,8 @@ genCCall (PrimTarget (MO_Ctz width)) [dst] [src]
, SUBFC dst r' (RIImm (ImmInt (format_bits)))
]
-genCCall target dest_regs argsAndHints
- = do platform <- getPlatform
- case target of
+genCCall platform target dest_regs argsAndHints
+ = do case target of
PrimTarget (MO_S_QuotRem width) -> divOp1 True width
dest_regs argsAndHints
PrimTarget (MO_U_QuotRem width) -> divOp1 False width
=====================================
docs/users_guide/rtd-theme/layout.html
=====================================
@@ -32,7 +32,7 @@
{%- if css|attr("rel") %}
<link rel="{{ css.rel }}" href="{{ pathto(css.filename, 1) }}" type="text/css"{% if css.title is not none %} title="{{ css.title }}"{% endif %} />
{%- else %}
- <link rel="stylesheet" href="{{ pathto(css, 1) }}" type="text/css" />
+ <link rel="stylesheet" href="{{ pathto(css.filename, 1) }}" type="text/css" />
{%- endif %}
{%- endfor %}
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/249d3c59efffe209ba8293339575e5…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/249d3c59efffe209ba8293339575e5…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26834] 19 commits: PPC NCG: Generate clear right insn at arch width
by Teo Camarasu (@teo) 29 Jan '26
by Teo Camarasu (@teo) 29 Jan '26
29 Jan '26
Teo Camarasu pushed to branch wip/T26834 at Glasgow Haskell Compiler / GHC
Commits:
56db94f7 by Peter Trommler at 2026-01-26T11:26:18+01:00
PPC NCG: Generate clear right insn at arch width
The clear right immediate (clrrxi) is only available in word and
doubleword width. Generate clrrxi instructions at architecture
width for all MachOp widths.
Fixes #24145
- - - - -
5957a8ad by Wolfgang Jeltsch at 2026-01-27T06:11:40-05:00
Add operations for obtaining operating-system handles
This contribution implements CLC proposal #369. It adds operations for
obtaining POSIX file descriptors and Windows handles that underlie
Haskell handles. Those operating system handles can also be obtained
without such additional operations, but this is more involved and, more
importantly, requires using internals.
- - - - -
86a0510c by Greg Steuck at 2026-01-27T06:12:34-05:00
Move flags to precede patterns for grep and read files directly
This makes the tests pass with non-GNU (i.e. POSIX-complicant) tools.
There's no reason to use cat and pipe where direct file argument works.
- - - - -
50761451 by Cheng Shao at 2026-01-27T21:51:23-05:00
ci: update darwin boot ghc to 9.10.3
This patch updates darwin boot ghc to 9.10.3, along with other related
updates, and pays off some technical debt here:
- Update `nixpkgs` and use the `nixpkgs-25.05-darwin` channel.
- Update the `niv` template.
- Update LLVM to 21 and update `llvm-targets` to reflect LLVM 21
layout changes for arm64/x86_64 darwin targets.
- Use `stdenvNoCC` to prevent nix packaged apple sdk from being used
by boot ghc, and manually set `DEVELOPER_DIR`/`SDKROOT` to enforce
the usage of system-wide command line sdk for macos.
- When building nix derivation for boot ghc, run `configure` via the
`arch` command so that `configure` and its subprocesses pick up the
manually specified architecture.
- Remove the previous horrible hack that obliterates `configure` to
make autoconf test result in true. `configure` now properly does its
job.
- Remove the now obsolete configure args and post install settings
file patching logic.
- Use `scheme-small` for texlive to avoid build failures in certain
unused texlive packages, especially on x86_64-darwin.
- - - - -
94dcd15e by Matthew Pickering at 2026-01-27T21:52:05-05:00
Evaluate backtraces for "error" exceptions at the moment they are thrown
See Note [Capturing the backtrace in throw] and
Note [Hiding precise exception signature in throw] which explain the
implementation.
This commit makes `error` and `throw` behave the same with regard to
backtraces. Previously, exceptions raised by `error` would not contain
useful IPE backtraces.
I did try and implement `error` in terms of `throw` but it started to
involve putting diverging functions into hs-boot files, which seemed to
risky if the compiler wouldn't be able to see if applying a function
would diverge.
CLC proposal: https://github.com/haskell/core-libraries-committee/issues/383
Fixes #26751
- - - - -
ef35e3ea by Teo Camarasu at 2026-01-27T21:52:46-05:00
ghc-internal: move all Data instances to Data.Data
Most instances of Data are defined in GHC.Internal.Data.Data.
Let's move all remaining instance there.
This moves other modules down in the dependency hierarchy allowing for
more parallelism, and it decreases the likelihood that we would need to
load this heavy .hi file if we don't actually need it.
Resolves #26830
Metric Decrease:
T12227
T16875
- - - - -
5e0ec555 by sheaf at 2026-01-28T06:56:38-05:00
Add test case for #25679
This commit adds the T25679 test case. The test now passes, thanks to
commit 1e53277af36d3f0b6ad5491f70ffc5593a49dcfd.
Fixes #25679
- - - - -
f1cd1611 by sheaf at 2026-01-28T06:56:38-05:00
Improve defaulting of representational equalities
This commit makes the defaulting of representational equalities, introduced
in 1e53277a, a little bit more robust. Now, instead of calling the eager
unifier, it calls the full-blown constraint solver, which means that it can
handle some subtle situations, e.g. involving functional dependencies and
type-family injectivity annotations, such as:
type family F a = r | r -> a
type instance F Int = Bool
[W] F beta ~R Bool
- - - - -
25edf516 by sheaf at 2026-01-28T06:56:38-05:00
Improve errors for unsolved representational equalities
This commit adds a new field of CtLoc, CtExplanations, which allows the
typechecker to leave some information about what it has done. For the moment,
it is only used to improve error messages for unsolved representational
equalities. The typechecker will now accumulate, when unifying at
representational role:
- out-of-scope newtype constructors,
- type constructors that have nominal role in a certain argument,
- over-saturated type constructors,
- AppTys, e.g. `c a ~R# c b`, to report that we must assume that 'c' has
nominal role in its parameters,
- data family applications that do not reduce, potentially preventing
newtype unwrapping.
Now, instead of having to re-construct the possible errors after the fact,
we simply consult the CtExplanations field.
Additionally, this commit modifies the typechecker error messages that
concern out-of-scope newtype constructors. The error message now depends
on whether we have an import suggestion to provide to the user:
- If we have an import suggestion for the newtype constructor,
the message will be of the form:
The data constructor MkN of the newtype N is out of scope
Suggested fix: add 'MkN' to the import list in the import of 'M'
- If we don't have any import suggestions, the message will be
of the form:
NB: The type 'N' is an opaque newtype, whose constructor is hidden
Fixes #15850, #20289, #20468, #23731, #25949, #26137
- - - - -
4d0e6da1 by Simon Peyton Jones at 2026-01-28T06:57:19-05:00
Fix two bugs in short-cut constraint solving
There are two main changes here:
* Use `isSolvedWC` rather than `isEmptyWC` in `tryShortCutSolver`
The residual constraint may have some fully-solved, but
still-there implications, and we don't want them to abort short
cut solving! That bug caused #26805.
* In the short-cut solver, we abandon the fully-solved residual
constraint; but we may thereby lose track of Givens that are
needed, and either report them as redundant or prune evidence
bindings that are in fact needed.
This bug stopped the `constraints` package from compiling;
see the trail in !15389.
The second bug led me to (another) significant refactoring
of the mechanism for tracking needed EvIds. See the new
Note [Tracking needed EvIds] in GHC.Tc.Solver.Solve
It's simpler and much less head-scratchy now.
Some particulars:
* An EvBindsVar now tracks NeededEvIds
* We deal with NeededEvIds for an implication only when it is
fully solved. Much simpler!
* `tryShortCutTcS` now takes a `TcM WantedConstraints` rather than
`TcM Bool`, so that is can plumb the needed EvIds correctly.
* Remove `ic_need` and `ic_need_implic` from Implication (hooray),
and add `ics_dm` and `ics_non_dm` to `IC_Solved`.
Pure refactor
* Shorten data constructor `CoercionHole` to `CH`, following
general practice in GHC.
* Rename `EvBindMap` to `EvBindsMap` for consistency
- - - - -
662480b7 by Cheng Shao at 2026-01-28T06:58:00-05:00
ci: use debian validate bindists instead of fedora release bindists in testing stage
This patch changes the `abi-test`, `hadrian-multi` and `perf` jobs in
the full-ci pipeline testing stage to use debian validate bindists
instead of fedora release bindists, to increase pipeline level
parallelism and allow full-ci pipelines to complete earlier. Closes #26818.
- - - - -
39581ec6 by Cheng Shao at 2026-01-28T06:58:40-05:00
ci: run perf test with -j$cores
This patch makes the perf ci job compile Cabal with -j$cores to speed
up the job.
- - - - -
607b287b by Wolfgang Jeltsch at 2026-01-28T15:41:53+02:00
Remove `GHC.Desugar` from `base`
`GHC.Desugar` was deprecated and should have been removed in GHC 9.14.
However, the removal was forgotten, although there was a code block that
was intended to trigger a compilation error when the GHC version in use
was 9.14 or later. This code sadly didn’t work, because the
`__GLASGOW_HASKELL__` macro was misspelled as `__GLASGOW_HASKELL`.
- - - - -
e8f5a45d by sterni at 2026-01-29T04:19:18-05:00
users_guide: fix runtime error during build with Sphinx 9.1.0
Appears that pathto is stricter about what it accepts now.
Tested Sphinx 8.2.3 and 9.1.0 on the ghc-9.10 branch.
Resolves #26810.
Co-authored-by: Martin Weinelt <hexa(a)darmstadt.ccc.de>
- - - - -
01b52108 by Teo Camarasu at 2026-01-29T16:34:24+00:00
ghc-internal: refine imports of GHC.Internal.Data.Bool
- - - - -
d02f2f54 by Teo Camarasu at 2026-01-29T16:34:24+00:00
Delete unecessary GHC.Internal.Data.Ix
- - - - -
d35d29c0 by Teo Camarasu at 2026-01-29T16:34:24+00:00
ghc-internal: refine List imports
- - - - -
fcd61dd3 by Teo Camarasu at 2026-01-29T16:34:24+00:00
Move MonadFix Identity into Monad.Fix
- - - - -
1dd15596 by Teo Camarasu at 2026-01-29T16:34:54+00:00
Split out GHC.Internal.Data.Ord.Down
- - - - -
162 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/darwin/nix/sources.json
- .gitlab/darwin/toolchain.nix
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCo/Tidy.hs
- compiler/GHC/Core/TyCon/RecWalk.hs
- compiler/GHC/Data/Maybe.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/CtLoc.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/RepType.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Utils/Monad.hs
- compiler/GHC/Utils/Trace.hs
- docs/users_guide/rtd-theme/layout.html
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Data/Foldable1.hs
- libraries/base/src/Data/Functor/Classes.hs
- libraries/base/src/Data/Ix.hs
- libraries/base/src/Data/Ord.hs
- − libraries/base/src/GHC/Desugar.hs
- + libraries/base/src/System/IO/OS.hs
- libraries/base/tests/IO/all.T
- + libraries/base/tests/IO/osHandles001FileDescriptors.hs
- + libraries/base/tests/IO/osHandles001FileDescriptors.stdout
- + libraries/base/tests/IO/osHandles001WindowsHandles.hs
- + libraries/base/tests/IO/osHandles001WindowsHandles.stdout
- + libraries/base/tests/IO/osHandles002FileDescriptors.hs
- + libraries/base/tests/IO/osHandles002FileDescriptors.stderr
- + libraries/base/tests/IO/osHandles002FileDescriptors.stdin
- + libraries/base/tests/IO/osHandles002FileDescriptors.stdout
- + libraries/base/tests/IO/osHandles002WindowsHandles.hs
- + libraries/base/tests/IO/osHandles002WindowsHandles.stderr
- + libraries/base/tests/IO/osHandles002WindowsHandles.stdin
- + libraries/base/tests/IO/osHandles002WindowsHandles.stdout
- libraries/base/tests/T23454.stderr
- libraries/base/tests/perf/Makefile
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/Zip.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Data.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Foldable.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Function.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs
- − libraries/ghc-internal/src/GHC/Internal/Data/Ix.hs
- libraries/ghc-internal/src/GHC/Internal/Data/List/NonEmpty.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Ord.hs
- + libraries/ghc-internal/src/GHC/Internal/Data/Ord/Down.hs
- libraries/ghc-internal/src/GHC/Internal/Data/String.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Traversable.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Type/Bool.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Version.hs
- libraries/ghc-internal/src/GHC/Internal/Err.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc
- libraries/ghc-internal/src/GHC/Internal/ExecutionStack/Internal.hsc
- libraries/ghc-internal/src/GHC/Internal/Exts.hs
- libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
- libraries/ghc-internal/src/GHC/Internal/Generics.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Encoding/CodePage.hs
- + libraries/ghc-internal/src/GHC/Internal/Prim.hs
- + libraries/ghc-internal/src/GHC/Internal/PrimopWrappers.hs
- libraries/ghc-internal/src/GHC/Internal/ResponseFile.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
- libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
- + libraries/ghc-internal/src/GHC/Internal/System/IO/OS.hs
- libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
- libraries/ghc-internal/src/GHC/Internal/TypeError.hs
- libraries/ghc-internal/tests/stack-annotation/all.T
- + libraries/ghc-internal/tests/stack-annotation/ann_frame005.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame005.stdout
- llvm-targets
- + testsuite/tests/default/T25825.hs
- testsuite/tests/default/all.T
- testsuite/tests/deriving/should_fail/T1496.stderr
- testsuite/tests/deriving/should_fail/T4846.stderr
- testsuite/tests/deriving/should_fail/T5498.stderr
- testsuite/tests/deriving/should_fail/T6147.stderr
- testsuite/tests/deriving/should_fail/T7148.stderr
- testsuite/tests/deriving/should_fail/T7148a.stderr
- testsuite/tests/deriving/should_fail/T8984.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail5.stderr
- testsuite/tests/driver/T16318/Makefile
- testsuite/tests/driver/T18125/Makefile
- testsuite/tests/gadt/CasePrune.stderr
- testsuite/tests/ghci.debugger/scripts/T8487.stdout
- testsuite/tests/ghci.debugger/scripts/break011.stdout
- testsuite/tests/ghci.debugger/scripts/break017.stdout
- testsuite/tests/ghci.debugger/scripts/break025.stdout
- testsuite/tests/indexed-types/should_fail/T9580.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- testsuite/tests/linear/should_fail/LinearRole.stderr
- testsuite/tests/roles/should_fail/RolesIArray.stderr
- + testsuite/tests/simplCore/should_compile/T26805.hs
- + testsuite/tests/simplCore/should_compile/T26805.stderr
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/typecheck/should_compile/T26805a.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T10285.stderr
- testsuite/tests/typecheck/should_fail/T10534.stderr
- testsuite/tests/typecheck/should_fail/T10715b.stderr
- testsuite/tests/typecheck/should_fail/T11347.stderr
- testsuite/tests/typecheck/should_fail/T15801.stderr
- + testsuite/tests/typecheck/should_fail/T15850.hs
- + testsuite/tests/typecheck/should_fail/T15850.stderr
- + testsuite/tests/typecheck/should_fail/T15850_Lib.hs
- + testsuite/tests/typecheck/should_fail/T20289.hs
- + testsuite/tests/typecheck/should_fail/T20289.stderr
- + testsuite/tests/typecheck/should_fail/T20289_A.hs
- testsuite/tests/typecheck/should_fail/T22645.stderr
- testsuite/tests/typecheck/should_fail/T22924a.stderr
- + testsuite/tests/typecheck/should_fail/T23731.hs
- + testsuite/tests/typecheck/should_fail/T23731.stderr
- + testsuite/tests/typecheck/should_fail/T23731b.hs
- + testsuite/tests/typecheck/should_fail/T23731b.stderr
- + testsuite/tests/typecheck/should_fail/T23731b_aux.hs
- + testsuite/tests/typecheck/should_fail/T25679.hs
- + testsuite/tests/typecheck/should_fail/T25679.stderr
- + testsuite/tests/typecheck/should_fail/T25949.hs
- + testsuite/tests/typecheck/should_fail/T25949.stderr
- + testsuite/tests/typecheck/should_fail/T25949_aux.hs
- + testsuite/tests/typecheck/should_fail/T26137.hs
- + testsuite/tests/typecheck/should_fail/T26137.stderr
- testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
- testsuite/tests/typecheck/should_fail/TcCoercibleFail3.stderr
- testsuite/tests/typecheck/should_fail/all.T
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2af36711d6167174c151c6a311ba0d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2af36711d6167174c151c6a311ba0d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0