Teo Camarasu pushed to branch wip/T26217 at Glasgow Haskell Compiler / GHC Commits: fc20efb3 by Teo Camarasu at 2025-08-17T22:53:32+01:00 ghc-internal: Move Data instance for TH.Syntax to Data.Data This means that Data.Data no longer blocks building TH.Syntax, which allows greater parallelism in our builds. Previously TH.Syntax was a bottleneck when compiling ghc-internal. Now it is less of a bottle-neck and is also slightly quicker to compile (since it no longer contains these instances) at the cost of making Data.Data slightly more expensive to compile. TH.Lift which depends on TH.Syntax can also compile quicker and no longer blocks ghc-internal finishing to compile. Resolves #26217 - - - - - 63b5b30d by Teo Camarasu at 2025-08-17T22:53:32+01:00 compiler: delete unused names in Builtins.Names.TH returnQ and bindQ are no longer used in the compiler. There was also a very old comment that referred to them that I have modernized - - - - - 4 changed files: - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/HsToCore/Quote.hs - libraries/ghc-internal/src/GHC/Internal/Data/Data.hs - libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs Changes: ===================================== compiler/GHC/Builtin/Names/TH.hs ===================================== @@ -30,7 +30,7 @@ templateHaskellNames :: [Name] -- Should stay in sync with the import list of GHC.HsToCore.Quote templateHaskellNames = [ - returnQName, bindQName, sequenceQName, newNameName, liftName, liftTypedName, + sequenceQName, newNameName, liftName, liftTypedName, mkNameName, mkNameG_vName, mkNameG_dName, mkNameG_tcName, mkNameG_fldName, mkNameLName, mkNameSName, mkNameQName, @@ -240,12 +240,10 @@ overlapTyConName = thTc (fsLit "Overlap") overlapTyConKey modNameTyConName = thTc (fsLit "ModName") modNameTyConKey quasiQuoterTyConName = mk_known_key_name tcName qqLib (fsLit "QuasiQuoter") quasiQuoterTyConKey -returnQName, bindQName, sequenceQName, newNameName, liftName, +sequenceQName, newNameName, liftName, mkNameName, mkNameG_vName, mkNameG_fldName, mkNameG_dName, mkNameG_tcName, mkNameLName, mkNameSName, liftStringName, unTypeName, unTypeCodeName, unsafeCodeCoerceName, liftTypedName, mkModNameName, mkNameQName :: Name -returnQName = thFun (fsLit "returnQ") returnQIdKey -bindQName = thFun (fsLit "bindQ") bindQIdKey sequenceQName = thMonadFun (fsLit "sequenceQ") sequenceQIdKey newNameName = thMonadFun (fsLit "newName") newNameIdKey mkNameName = thFun (fsLit "mkName") mkNameIdKey @@ -812,12 +810,10 @@ dataNamespaceSpecifierDataConKey = mkPreludeDataConUnique 215 -- IdUniques available: 200-499 -- If you want to change this, make sure you check in GHC.Builtin.Names -returnQIdKey, bindQIdKey, sequenceQIdKey, liftIdKey, newNameIdKey, +sequenceQIdKey, liftIdKey, newNameIdKey, mkNameIdKey, mkNameG_vIdKey, mkNameG_fldIdKey, mkNameG_dIdKey, mkNameG_tcIdKey, mkNameLIdKey, mkNameSIdKey, unTypeIdKey, unTypeCodeIdKey, unsafeCodeCoerceIdKey, liftTypedIdKey, mkModNameIdKey, mkNameQIdKey :: Unique -returnQIdKey = mkPreludeMiscIdUnique 200 -bindQIdKey = mkPreludeMiscIdUnique 201 sequenceQIdKey = mkPreludeMiscIdUnique 202 liftIdKey = mkPreludeMiscIdUnique 203 newNameIdKey = mkPreludeMiscIdUnique 204 ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -245,14 +245,14 @@ first generate a polymorphic definition and then just apply the wrapper at the e [| \x -> x |] ====> - gensym (unpackString "x"#) `bindQ` \ x1::String -> - lam (pvar x1) (var x1) + newName (unpackString "x"#) >>= \ x1::Name -> + lamE (varP x1) (varE x1) [| \x -> $(f [| x |]) |] ====> - gensym (unpackString "x"#) `bindQ` \ x1::String -> - lam (pvar x1) (f (var x1)) + newName (unpackString "x"#) >>= \ x1::Name -> + lamE (varP x1) (f (varE x1)) -} ===================================== libraries/ghc-internal/src/GHC/Internal/Data/Data.hs ===================================== @@ -143,6 +143,7 @@ import GHC.Internal.Arr -- So we can give Data instance for Array import qualified GHC.Internal.Generics as Generics (Fixity(..)) import GHC.Internal.Generics hiding (Fixity(..)) -- So we can give Data instance for U1, V1, ... +import qualified GHC.Internal.TH.Syntax as TH ------------------------------------------------------------------------------ -- @@ -1353,3 +1354,63 @@ deriving instance Data DecidedStrictness -- | @since base-4.12.0.0 deriving instance Data a => Data (Down a) + +---------------------------------------------------------------------------- +-- Data instances for GHC.Internal.TH.Syntax + +deriving instance Data TH.AnnLookup +deriving instance Data TH.AnnTarget +deriving instance Data TH.Bang +deriving instance Data TH.BndrVis +deriving instance Data TH.Body +deriving instance Data TH.Bytes +deriving instance Data TH.Callconv +deriving instance Data TH.Clause +deriving instance Data TH.Con +deriving instance Data TH.Dec +deriving instance Data TH.DecidedStrictness +deriving instance Data TH.DerivClause +deriving instance Data TH.DerivStrategy +deriving instance Data TH.DocLoc +deriving instance Data TH.Exp +deriving instance Data TH.FamilyResultSig +deriving instance Data TH.Fixity +deriving instance Data TH.FixityDirection +deriving instance Data TH.Foreign +deriving instance Data TH.FunDep +deriving instance Data TH.Guard +deriving instance Data TH.Info +deriving instance Data TH.InjectivityAnn +deriving instance Data TH.Inline +deriving instance Data TH.Lit +deriving instance Data TH.Loc +deriving instance Data TH.Match +deriving instance Data TH.ModName +deriving instance Data TH.Module +deriving instance Data TH.ModuleInfo +deriving instance Data TH.Name +deriving instance Data TH.NameFlavour +deriving instance Data TH.NameSpace +deriving instance Data TH.NamespaceSpecifier +deriving instance Data TH.OccName +deriving instance Data TH.Overlap +deriving instance Data TH.Pat +deriving instance Data TH.PatSynArgs +deriving instance Data TH.PatSynDir +deriving instance Data TH.Phases +deriving instance Data TH.PkgName +deriving instance Data TH.Pragma +deriving instance Data TH.Range +deriving instance Data TH.Role +deriving instance Data TH.RuleBndr +deriving instance Data TH.RuleMatch +deriving instance Data TH.Safety +deriving instance Data TH.SourceStrictness +deriving instance Data TH.SourceUnpackedness +deriving instance Data TH.Specificity +deriving instance Data TH.Stmt +deriving instance Data TH.TyLit +deriving instance Data TH.TySynEqn +deriving instance Data TH.Type +deriving instance Data TH.TypeFamilyHead +deriving instance Data flag => Data (TH.TyVarBndr flag) ===================================== libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs ===================================== @@ -1,14 +1,16 @@ {-# OPTIONS_HADDOCK not-home #-} -- we want users to import Language.Haskell.TH.Syntax instead -{-# LANGUAGE CPP, DeriveDataTypeable, - DeriveGeneric, FlexibleInstances, DefaultSignatures, - RankNTypes, RoleAnnotations, ScopedTypeVariables, - MagicHash, KindSignatures, PolyKinds, TypeApplications, DataKinds, - GADTs, UnboxedTuples, UnboxedSums, TypeOperators, - Trustworthy, DeriveFunctor, DeriveTraversable, - BangPatterns, RecordWildCards, ImplicitParams #-} - -{-# LANGUAGE TemplateHaskellQuotes #-} -{-# LANGUAGE StandaloneKindSignatures #-} +{-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE RoleAnnotations #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE Safe #-} +{-# LANGUAGE UnboxedTuples #-} -- | This module is used internally in GHC's integration with Template Haskell -- and defines the abstract syntax of Template Haskell. @@ -26,7 +28,6 @@ module GHC.Internal.TH.Syntax #ifdef BOOTSTRAP_TH import Prelude -import Data.Data hiding (Fixity(..)) import System.IO.Unsafe ( unsafePerformIO ) import Data.Char ( isAlpha, isAlphaNum, isUpper ) import Data.List.NonEmpty ( NonEmpty(..) ) @@ -38,7 +39,6 @@ import GHC.Ptr ( Ptr, plusPtr ) import GHC.Generics ( Generic ) #else import GHC.Internal.Base hiding (NonEmpty(..),Type, Module, sequence) -import GHC.Internal.Data.Data hiding (Fixity(..)) import GHC.Internal.Data.NonEmpty (NonEmpty(..)) import GHC.Internal.Data.Traversable import GHC.Internal.Word @@ -72,19 +72,19 @@ manyName = mkNameG DataName "ghc-internal" "GHC.Internal.Types" "Many" -- | The name of a module. newtype ModName = ModName String -- Module name - deriving (Show,Eq,Ord,Data,Generic) + deriving (Show,Eq,Ord,Generic) -- | The name of a package. newtype PkgName = PkgName String -- package name - deriving (Show,Eq,Ord,Data,Generic) + deriving (Show,Eq,Ord,Generic) -- | Obtained from 'reifyModule' and 'Language.Haskell.TH.Lib.thisModule'. data Module = Module PkgName ModName -- package qualified module name - deriving (Show,Eq,Ord,Data,Generic) + deriving (Show,Eq,Ord,Generic) -- | An "Occurence Name". newtype OccName = OccName String - deriving (Show,Eq,Ord,Data,Generic) + deriving (Show,Eq,Ord,Generic) -- | Smart constructor for 'ModName' mkModName :: String -> ModName @@ -200,7 +200,7 @@ Names constructed using @newName@ and @mkName@ may be used in bindings (such as @let x = ...@ or @\x -> ...@), but names constructed using @lookupValueName@, @lookupTypeName@, @'f@, @''T@ may not. -} -data Name = Name OccName NameFlavour deriving (Data, Eq, Generic) +data Name = Name OccName NameFlavour deriving (Eq, Generic) instance Ord Name where -- check if unique is different before looking at strings @@ -216,7 +216,7 @@ data NameFlavour -- An original name (occurrences only, not binders) -- Need the namespace too to be sure which -- thing we are naming - deriving ( Data, Eq, Ord, Show, Generic ) + deriving ( Eq, Ord, Show, Generic ) data NameSpace = VarName -- ^ Variables | DataName -- ^ Data constructors @@ -230,7 +230,7 @@ data NameSpace = VarName -- ^ Variables -- of the datatype (regardless of whether this constructor has this field). -- - For a field of a pattern synonym, this is the name of the pattern synonym. } - deriving( Eq, Ord, Show, Data, Generic ) + deriving( Eq, Ord, Show, Generic ) -- | @Uniq@ is used by GHC to distinguish names from each other. type Uniq = Integer @@ -532,7 +532,7 @@ data Loc , loc_module :: String , loc_start :: CharPos , loc_end :: CharPos } - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) type CharPos = (Int, Int) -- ^ Line and character position @@ -615,13 +615,13 @@ data Info | TyVarI -- Scoped type variable Name Type -- What it is bound to - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | Obtained from 'reifyModule' in the 'Q' Monad. data ModuleInfo = -- | Contains the import list of the module. ModuleInfo [Module] - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) {- | In 'ClassOpI' and 'DataConI', name of the parent class or type @@ -659,11 +659,11 @@ type InstanceDec = Dec -- | Fixity, as specified in a @infix[lr] n@ declaration. data Fixity = Fixity Int FixityDirection - deriving( Eq, Ord, Show, Data, Generic ) + deriving( Eq, Ord, Show, Generic ) -- | The associativity of an operator, as in an @infix@ declaration. data FixityDirection = InfixL | InfixR | InfixN - deriving( Eq, Ord, Show, Data, Generic ) + deriving( Eq, Ord, Show, Generic ) -- | Highest allowed operator precedence for 'Fixity' constructor (answer: 9) maxPrecedence :: Int @@ -696,7 +696,7 @@ data Lit = CharL Char -- ^ @\'c\'@ | StringPrimL [Word8] -- ^ @"string"#@. A primitive C-style string, type 'Addr#' | BytesPrimL Bytes -- ^ Some raw bytes, type 'Addr#': | CharPrimL Char -- ^ @\'c\'#@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- We could add Int, Float, Double etc, as we do in HsLit, -- but that could complicate the @@ -718,7 +718,7 @@ data Bytes = Bytes -- , bytesInitialized :: Bool -- ^ False: only use `bytesSize` to allocate -- -- an uninitialized region } - deriving (Data,Generic) + deriving (Generic) -- We can't derive Show instance for Bytes because we don't want to show the -- pointer value but the actual bytes (similarly to what ByteString does). See @@ -785,14 +785,14 @@ data Pat | TypeP Type -- ^ @{ type p }@ | InvisP Type -- ^ @{ @p }@ | OrP (NonEmpty Pat) -- ^ @{ p1; p2 }@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A (field name, pattern) pair. See 'RecP'. type FieldPat = (Name,Pat) -- | A @case@-alternative data Match = Match Pat Body [Dec] -- ^ @case e of { pat -> body where decs }@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A clause consists of patterns, guards, a body expression, and a list of -- declarations under a @where@. Clauses are seen in equations for function @@ -800,7 +800,7 @@ data Match = Match Pat Body [Dec] -- ^ @case e of { pat -> body where decs }@ -- etc. data Clause = Clause [Pat] Body [Dec] -- ^ @f { p1 p2 = body where decs }@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A Haskell expression. data Exp @@ -895,7 +895,7 @@ data Exp | ForallE [TyVarBndr Specificity] Exp -- ^ @forall \<vars\>. \<expr\>@ | ForallVisE [TyVarBndr ()] Exp -- ^ @forall \<vars\> -> \<expr\>@ | ConstrainedE [Exp] Exp -- ^ @\<ctxt\> => \<expr\>@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A (field name, expression) pair. See 'RecConE' and 'RecUpdE'. type FieldExp = (Name,Exp) @@ -909,13 +909,13 @@ data Body -- | e3 = e4 } -- where ds@ | NormalB Exp -- ^ @f p { = e } where ds@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A single guard. data Guard = NormalG Exp -- ^ @f x { | odd x } = x@ | PatG [Stmt] -- ^ @f x { | Just y <- x, Just z <- y } = z@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A single statement, as in @do@-notation. data Stmt @@ -924,14 +924,14 @@ data Stmt | NoBindS Exp -- ^ @e@ | ParS [[Stmt]] -- ^ @x <- e1 | s2, s3 | s4@ (in 'CompE') | RecS [Stmt] -- ^ @rec { s1; s2 }@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A list/enum range expression. data Range = FromR Exp -- ^ @[n ..]@ | FromThenR Exp Exp -- ^ @[n, m ..]@ | FromToR Exp Exp -- ^ @[n .. m]@ | FromThenToR Exp Exp Exp -- ^ @[n, m .. k]@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A single declaration. data Dec @@ -1018,7 +1018,7 @@ data Dec -- -- Implicit parameter binding declaration. Can only be used in let -- and where clauses which consist entirely of implicit bindings. - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A way to specify a namespace to look in when GHC needs to find -- a name's source @@ -1030,7 +1030,7 @@ data NamespaceSpecifier -- or type variable | DataNamespaceSpecifier -- ^ Name should be a term-level entity, such as a -- function, data constructor, or pattern synonym - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | Varieties of allowed instance overlap. data Overlap = Overlappable -- ^ May be overlapped by more specific instances @@ -1039,12 +1039,12 @@ data Overlap = Overlappable -- ^ May be overlapped by more specific instances | Incoherent -- ^ Both 'Overlapping' and 'Overlappable', and -- pick an arbitrary one if multiple choices are -- available. - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A single @deriving@ clause at the end of a datatype declaration. data DerivClause = DerivClause (Maybe DerivStrategy) Cxt -- ^ @{ deriving stock (Eq, Ord) }@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | What the user explicitly requests when deriving an instance with -- @-XDerivingStrategies@. @@ -1052,7 +1052,7 @@ data DerivStrategy = StockStrategy -- ^ @deriving {stock} C@ | AnyclassStrategy -- ^ @deriving {anyclass} C@, @-XDeriveAnyClass@ | NewtypeStrategy -- ^ @deriving {newtype} C@, @-XGeneralizedNewtypeDeriving@ | ViaStrategy Type -- ^ @deriving C {via T}@, @-XDerivingVia@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A pattern synonym's type. Note that a pattern synonym's /fully/ -- specified type has a peculiar shape coming with two forall @@ -1108,7 +1108,7 @@ type PatSynType = Type -- between @type family@ and @where@. data TypeFamilyHead = TypeFamilyHead Name [TyVarBndr BndrVis] FamilyResultSig (Maybe InjectivityAnn) - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | One equation of a type family instance or closed type family. The -- arguments are the left-hand-side type and the right-hand-side result. @@ -1128,28 +1128,28 @@ data TypeFamilyHead = -- ('VarT' a) -- @ data TySynEqn = TySynEqn (Maybe [TyVarBndr ()]) Type Type - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | [Functional dependency](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/functional_dependenc...) -- syntax, as in a class declaration. data FunDep = FunDep [Name] [Name] -- ^ @class C a b {| a -> b}@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A @foreign@ declaration. data Foreign = ImportF Callconv Safety String Name Type -- ^ @foreign import callconv safety "foreign_name" haskellName :: type@ | ExportF Callconv String Name Type -- ^ @foreign export callconv "foreign_name" haskellName :: type@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- keep Callconv in sync with module ForeignCall in ghc/compiler/GHC/Types/ForeignCall.hs -- | A calling convention identifier, as in a 'Foreign' declaration. data Callconv = CCall | StdCall | CApi | Prim | JavaScript - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A safety level, as in a 'Foreign' declaration. data Safety = Unsafe | Safe | Interruptible - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) data Pragma = InlineP Name Inline RuleMatch Phases -- ^ @{ {\-\# [inline] [rule match] [phases] [phases] name #-} }@. See @@ -1174,7 +1174,7 @@ data Pragma = InlineP Name Inline RuleMatch Phases -- ^ @{ {\-\# COMPLETE C_1, ..., C_i [ :: T ] \#-} }@ | SCCP Name (Maybe String) -- ^ @{ {\-\# SCC fun "optional_name" \#-} }@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | An inline pragma. data Inline = NoInline @@ -1183,7 +1183,7 @@ data Inline = NoInline -- ^ @{ {\-\# INLINE ... #-} }@ | Inlinable -- ^ @{ {\-\# INLINABLE ... #-} }@ - deriving (Show, Eq, Ord, Data, Generic) + deriving (Show, Eq, Ord, Generic) -- | A @CONLIKE@ modifier, as in one of the various inline pragmas, or lack -- thereof ('FunLike'). @@ -1191,7 +1191,7 @@ data RuleMatch = ConLike -- ^ @{ {\-\# CONLIKE [inline] ... #-} }@ | FunLike -- ^ @{ {\-\# [inline] ... #-} }@ - deriving (Show, Eq, Ord, Data, Generic) + deriving (Show, Eq, Ord, Generic) -- | Phase control syntax. data Phases = AllPhases @@ -1200,14 +1200,14 @@ data Phases = AllPhases -- ^ @[n]@ | BeforePhase Int -- ^ @[~n]@ - deriving (Show, Eq, Ord, Data, Generic) + deriving (Show, Eq, Ord, Generic) -- | A binder found in the @forall@ of a @RULES@ pragma. data RuleBndr = RuleVar Name -- ^ @forall {a} ... .@ | TypedRuleVar Name Type -- ^ @forall {(a :: t)} ... .@ - deriving (Show, Eq, Ord, Data, Generic) + deriving (Show, Eq, Ord, Generic) -- | The target of an @ANN@ pragma data AnnTarget = ModuleAnnotation @@ -1216,7 +1216,7 @@ data AnnTarget = ModuleAnnotation -- ^ @{\-\# ANN type {name} ... #-}@ | ValueAnnotation Name -- ^ @{\-\# ANN {name} ... #-}@ - deriving (Show, Eq, Ord, Data, Generic) + deriving (Show, Eq, Ord, Generic) -- | A context, as found on the left side of a @=>@ in a type. type Cxt = [Pred] -- ^ @(Eq a, Ord b)@ @@ -1234,7 +1234,7 @@ data SourceUnpackedness = NoSourceUnpackedness -- ^ @C a@ | SourceNoUnpack -- ^ @C { {\-\# NOUNPACK \#-\} } a@ | SourceUnpack -- ^ @C { {\-\# UNPACK \#-\} } a@ - deriving (Show, Eq, Ord, Data, Generic) + deriving (Show, Eq, Ord, Generic) -- | 'SourceStrictness' corresponds to strictness annotations found in the source code. -- @@ -1243,7 +1243,7 @@ data SourceUnpackedness data SourceStrictness = NoSourceStrictness -- ^ @C a@ | SourceLazy -- ^ @C {~}a@ | SourceStrict -- ^ @C {!}a@ - deriving (Show, Eq, Ord, Data, Generic) + deriving (Show, Eq, Ord, Generic) -- | Unlike 'SourceStrictness' and 'SourceUnpackedness', 'DecidedStrictness' -- refers to the strictness annotations that the compiler chooses for a data constructor @@ -1256,7 +1256,7 @@ data SourceStrictness = NoSourceStrictness -- ^ @C a@ data DecidedStrictness = DecidedLazy -- ^ Field inferred to not have a bang. | DecidedStrict -- ^ Field inferred to have a bang. | DecidedUnpack -- ^ Field inferred to be unpacked. - deriving (Show, Eq, Ord, Data, Generic) + deriving (Show, Eq, Ord, Generic) -- | A data constructor. -- @@ -1321,7 +1321,7 @@ data Con = -- Invariant: the list must be non-empty. [VarBangType] -- ^ The constructor arguments Type -- ^ See Note [GADT return type] - deriving (Show, Eq, Ord, Data, Generic) + deriving (Show, Eq, Ord, Generic) -- Note [GADT return type] -- ~~~~~~~~~~~~~~~~~~~~~~~ @@ -1353,7 +1353,7 @@ data Con = -- | Strictness information in a data constructor's argument. data Bang = Bang SourceUnpackedness SourceStrictness -- ^ @C { {\-\# UNPACK \#-\} !}a@ - deriving (Show, Eq, Ord, Data, Generic) + deriving (Show, Eq, Ord, Generic) -- | A type with a strictness annotation, as in data constructors. See 'Con'. type BangType = (Bang, Type) @@ -1377,14 +1377,14 @@ data PatSynDir = Unidir -- ^ @pattern P x {<-} p@ | ImplBidir -- ^ @pattern P x {=} p@ | ExplBidir [Clause] -- ^ @pattern P x {<-} p where P x = e@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A pattern synonym's argument type. data PatSynArgs = PrefixPatSyn [Name] -- ^ @pattern P {x y z} = p@ | InfixPatSyn Name Name -- ^ @pattern {x P y} = p@ | RecordPatSyn [Name] -- ^ @pattern P { {x,y,z} } = p@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | A Haskell type. data Type = ForallT [TyVarBndr Specificity] Cxt Type -- ^ @forall \<vars\>. \<ctxt\> => \<type\>@ @@ -1423,12 +1423,12 @@ data Type = ForallT [TyVarBndr Specificity] Cxt Type -- ^ @forall \<vars\>. \<ct | LitT TyLit -- ^ @0@, @1@, @2@, etc. | WildCardT -- ^ @_@ | ImplicitParamT String Type -- ^ @?x :: t@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | The specificity of a type variable in a @forall ...@. data Specificity = SpecifiedSpec -- ^ @a@ | InferredSpec -- ^ @{a}@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | The @flag@ type parameter is instantiated to one of the following types: -- @@ -1438,40 +1438,40 @@ data Specificity = SpecifiedSpec -- ^ @a@ -- data TyVarBndr flag = PlainTV Name flag -- ^ @a@ | KindedTV Name flag Kind -- ^ @(a :: k)@ - deriving( Show, Eq, Ord, Data, Generic, Functor, Foldable, Traversable ) + deriving( Show, Eq, Ord, Generic, Functor, Foldable, Traversable ) -- | Visibility of a type variable. See [Inferred vs. specified type variables](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/type_applications.ht...). data BndrVis = BndrReq -- ^ @a@ | BndrInvis -- ^ @\@a@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | Type family result signature data FamilyResultSig = NoSig -- ^ no signature | KindSig Kind -- ^ @k@ | TyVarSig (TyVarBndr ()) -- ^ @= r, = (r :: k)@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | Injectivity annotation as in an [injective type family](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/type_families.html) data InjectivityAnn = InjectivityAnn Name [Name] - deriving ( Show, Eq, Ord, Data, Generic ) + deriving ( Show, Eq, Ord, Generic ) -- | Type-level literals. data TyLit = NumTyLit Integer -- ^ @2@ | StrTyLit String -- ^ @\"Hello\"@ | CharTyLit Char -- ^ @\'C\'@, @since 4.16.0.0 - deriving ( Show, Eq, Ord, Data, Generic ) + deriving ( Show, Eq, Ord, Generic ) -- | Role annotations data Role = NominalR -- ^ @nominal@ | RepresentationalR -- ^ @representational@ | PhantomR -- ^ @phantom@ | InferR -- ^ @_@ - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | Annotation target for reifyAnnotations data AnnLookup = AnnLookupModule Module | AnnLookupName Name - deriving( Show, Eq, Ord, Data, Generic ) + deriving( Show, Eq, Ord, Generic ) -- | To avoid duplication between kinds and types, they -- are defined to be the same. Naturally, you would never @@ -1522,7 +1522,7 @@ data DocLoc | ArgDoc Name Int -- ^ At a specific argument of a function, indexed by its -- position. | InstDoc Type -- ^ At a class or family instance. - deriving ( Show, Eq, Ord, Data, Generic ) + deriving ( Show, Eq, Ord, Generic ) ----------------------------------------------------- -- Internal helper functions View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e12cc06278f97f1b13ec1dddf5dcd81... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e12cc06278f97f1b13ec1dddf5dcd81... You're receiving this email because of your account on gitlab.haskell.org.