recursion-ninja pushed to branch wip/TTG-Fewer-Orphans at Glasgow Haskell Compiler / GHC Commits: d350ace7 by Recursion Ninja at 2026-08-28T18:55:11-04:00 Resolving even more TTG related orphan type-class instances Related to #21262 and #27469, both closed by 43dd2b15a2. This commit addresses the technical debt remaining the end of the TTG project. Orphan instances of data-types from within 'L.H.S' have been moved to either: 1. The module which defines the data-type 2. The module which defines the type-class; i.e. moving an orphan 'Binary' instance to 'GHC.Utils.Binary' The instances remaining after 43dd2b15a2 could not be relocated verbatim. 'GHC.Utils.Outputable' and 'GHC.Utils.Binary' sat below the AST in the import graph, so a type-class module could see the 'GhcPass' type-family equations that the instance bodies rely on. A new module, 'GHC.Hs.Extension.Instances', collects the 'GhcPass' instantiation of the Trees-that-Grow extension points previously declared in 'GHC.Hs.Extension.Pass', allowing more orphan type-class instance to be reolved. Orphan instances resolved (82): | Data-type | Resolved instance(s) | Former orphan module(s) | | ------------------- | -------------------------------------- | ------------------------------ | | BCOByteArray | Binary | GHC.ByteCode.Binary | | BCONPtr | Binary | GHC.ByteCode.Binary | | BCOPtr | Binary | GHC.ByteCode.Binary | | ByteCodeHpcInfo | Binary | GHC.ByteCode.Binary | | CompiledByteCode | Binary | GHC.ByteCode.Binary | | UnlinkedBCO | Binary | GHC.ByteCode.Binary | | BooleanFormula | Outputable | GHC.Data.BooleanFormula | | HsLocalBindsLR | Outputable | GHC.Hs.Binds | | RecordPatSynField | Outputable | GHC.Hs.Binds | | ValBind | HasLoc | GHC.Hs.Binds | | DerivClauseTys | Outputable | GHC.Hs.Decls | | DocDecl | Outputable | GHC.Hs.Decls | | FamilyInfo | Outputable | GHC.Hs.Decls | | ForeignExport | Outputable | GHC.Hs.Decls | | FunDep | Outputable | GHC.Hs.Decls | | HsDecl | Outputable | GHC.Hs.Decls | | InstDecl | Outputable | GHC.Hs.Decls | | RoleAnnotDecl | Outputable | GHC.Hs.Decls | | SpliceDecoration | Outputable | GHC.Hs.Decls | | StandaloneKindSig | Outputable | GHC.Hs.Decls | | TyClGroup | Outputable | GHC.Hs.Decls | | WarnDecl | Outputable | GHC.Hs.Decls | | HsDocString | Binary, Outputable, Show | GHC.Hs.DocString | | ArithSeqInfo | Outputable | GHC.Hs.Expr | | DotFieldOcc | Outputable | GHC.Hs.Expr | | FieldLabelStrings | Outputable, OutputableBndr | GHC.Hs.Expr | | HsArrowMatchContext | Outputable | GHC.Hs.Expr | | HsLamVariant | Outputable | GHC.Hs.Expr | | HsMatchContext | Outputable | GHC.Hs.Expr | | Located | OutputableBndr | GHC.Hs.Expr | | ParStmtBlock | Outputable | GHC.Hs.Expr | | DataConCantHappen | Outputable | GHC.Hs.Extension | | NoExtField | Outputable | GHC.Hs.Extension | | IEWrappedName | Outputable, OutputableBndr, HasOccName | GHC.Hs.ImpExp | | FractionalLit | Outputable, Show | GHC.Hs.Lit | | HsLit | Outputable | GHC.Hs.Lit | | HsQualLit | Outputable | GHC.Hs.Lit | | IntegralLit | Outputable, Show | GHC.Hs.Lit | | OverLitVal | Outputable | GHC.Hs.Lit | | QualLitVal | Outputable | GHC.Hs.Lit | | StringLiteral | Outputable, Show | GHC.Hs.Lit | | HsFieldBind | Outputable | GHC.Hs.Pat | | FieldOcc | Outputable, OutputableBndr | GHC.Hs.Type | | GenLocated | OutputableBndr | GHC.Hs.Type | | HsBndrVar | Outputable | GHC.Hs.Type | | HsConDetails | Outputable | GHC.Hs.Type | | HsContextDetails | Outputable | GHC.Hs.Type | | HsForAllTelescope | Outputable | GHC.Hs.Type | | HsIPName | Outputable, OutputableBndr | GHC.Hs.Type | | HsPatSigType | Outputable | GHC.Hs.Type | | HsTyPat | Outputable | GHC.Hs.Type | | HsWildCardBndrs | Outputable | GHC.Hs.Type | | LHsQTyVars | Outputable | GHC.Hs.Type | | HsArg | Outputable, HasLoc | GHC.Hs.Type, GHC.Iface.Ext.Ast | | DataDefnCons | HasLoc | GHC.Iface.Ext.Ast | | HsDataDefn | HasLoc | GHC.Iface.Ext.Ast | | CCallConv | Binary, Outputable | GHC.Types.ForeignCall | | CCallTarget | Binary | GHC.Types.ForeignCall | | CExportSpec | Binary, Outputable | GHC.Types.ForeignCall | | CType | Binary | GHC.Types.ForeignCall | | ForeignKind | Binary | GHC.Types.ForeignCall | | Header | Binary, Outputable | GHC.Types.ForeignCall | | Safety | Binary, Outputable | GHC.Types.ForeignCall | | FieldLabel | NFData | GHC.Types.Name | | InWarningCategory | Outputable | GHC.Unit.Module.Warnings | | WarningCategory | Binary, Outputable | GHC.Unit.Module.Warnings | Two instances for 'GhcPass' cannot have thier orphaned status resolved, but were migrated to a "more defensible" home instead: - 'WrapXRec' to 'GHC.Hs.Extension' - 'BooleanFormulaDefault' to 'GHC.Hs.Extension.Instances' - - - - - 32 changed files: - compiler/GHC/ByteCode/Binary.hs - compiler/GHC/ByteCode/Types.hs - compiler/GHC/Core/Class.hs - compiler/GHC/Data/BooleanFormula.hs - compiler/GHC/Hs/Binds.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/DocString.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Extension.hs - + compiler/GHC/Hs/Extension/Instances.hs - compiler/GHC/Hs/Extension/Pass.hs - compiler/GHC/Hs/ImpExp.hs - compiler/GHC/Hs/Lit.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Types/FieldLabel.hs - compiler/GHC/Types/ForeignCall.hs - compiler/GHC/Types/Name.hs - compiler/GHC/Types/Name/Occurrence.hs - compiler/GHC/Types/SourceText.hs - compiler/GHC/Types/SrcLoc.hs - compiler/GHC/Unit/Module/Warnings.hs - compiler/GHC/Utils/Binary.hs - compiler/GHC/Utils/Lexeme.hs - compiler/GHC/Utils/Outputable.hs - compiler/Language/Haskell/Syntax/Doc.hs - compiler/Language/Haskell/Syntax/ImpExp.hs - compiler/Language/Haskell/Syntax/Lit.hs - compiler/ghc.cabal.in - testsuite/tests/count-deps/CountDepsParser.stdout The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d350ace750e86e5091fb1e2751a6a9f0... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d350ace750e86e5091fb1e2751a6a9f0... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help