[Git][ghc/ghc][wip/T24477] wip
Jade (@Jade)
gitlab at gitlab.haskell.org
Tue May 7 13:03:32 UTC 2024
Jade pushed to branch wip/T24477 at Glasgow Haskell Compiler / GHC
Commits:
5964db25 by Jade at 2024-05-07T15:02:56+02:00
wip
- - - - -
1 changed file:
- compiler/GHC/Driver/Flags.hs
Changes:
=====================================
compiler/GHC/Driver/Flags.hs
=====================================
@@ -91,9 +91,11 @@ data ExtensionDeprecation
| ExtensionFlagDeprecated String
deriving Eq
-deprecation :: ExtensionDeprecation -> Deprecation
-deprecation ExtensionNotDeprecated = NotDeprecated
-deprecation _ = Deprecated
+deprecation :: ExtensionDeprecation -> TurnOnFlag -> Deprecation
+deprecation ExtensionNotDeprecated _ = NotDeprecated
+deprecation (ExtensionFlagDeprecatedCond f _) flag
+ | flag /= f = NotDeprecated
+deprecation _ _ = Deprecated
extensionDeprecation :: LangExt.Extension -> ExtensionDeprecation
extensionDeprecation = \case
@@ -110,9 +112,141 @@ extensionDeprecation = \case
_ -> ExtensionNotDeprecated
+-- JADE_TODO
extensionName :: LangExt.Extension -> String
-extensionName LangExt.Cpp = "CPP"
-extensionName ext = show ext
+extensionName = \case
+ LangExt.Cpp -> "CPP"
+ LangExt.OverlappingInstances -> "OverlappingInstances"
+ LangExt.UndecidableInstances -> "UndecidableInstances"
+ LangExt.IncoherentInstances -> "IncoherentInstances"
+ LangExt.UndecidableSuperClasses -> "UndecidableSuperClasses"
+ LangExt.MonomorphismRestriction -> "MonomorphismRestriction"
+ LangExt.MonoLocalBinds -> "MonoLocalBinds"
+ LangExt.DeepSubsumption -> "DeepSubsumption"
+ LangExt.RelaxedPolyRec -> "RelaxedPolyRec" -- Deprecated
+ LangExt.ExtendedDefaultRules -> "ExtendedDefaultRules" -- Use GHC's extended rules for defaulting
+ LangExt.ForeignFunctionInterface -> "ForeignFunctionInterface"
+ LangExt.UnliftedFFITypes -> "UnliftedFFITypes"
+ LangExt.InterruptibleFFI -> "InterruptibleFFI"
+ LangExt.CApiFFI -> "CApiFFI"
+ LangExt.GHCForeignImportPrim -> "GHCForeignImportPrim"
+ LangExt.JavaScriptFFI -> "JavaScriptFFI"
+ LangExt.ParallelArrays -> "ParallelArrays" -- Syntactic support for parallel arrays
+ LangExt.Arrows -> "Arrows" -- Arrow-notation syntax
+ LangExt.TemplateHaskell -> "TemplateHaskell"
+ LangExt.TemplateHaskellQuotes -> "TemplateHaskellQuotes" -- subset of TH supported by stage1, no splice
+ LangExt.QualifiedDo -> "QualifiedDo"
+ LangExt.QuasiQuotes -> "QuasiQuotes"
+ LangExt.ImplicitParams -> "ImplicitParams"
+ LangExt.ImplicitPrelude -> "ImplicitPrelude"
+ LangExt.ScopedTypeVariables -> "ScopedTypeVariables"
+ LangExt.AllowAmbiguousTypes -> "AllowAmbiguousTypes"
+ LangExt.UnboxedTuples -> "UnboxedTuples"
+ LangExt.UnboxedSums -> "UnboxedSums"
+ LangExt.UnliftedNewtypes -> "UnliftedNewtypes"
+ LangExt.UnliftedDatatypes -> "UnliftedDatatypes"
+ LangExt.BangPatterns -> "BangPatterns"
+ LangExt.TypeFamilies -> "TypeFamilies"
+ LangExt.TypeFamilyDependencies -> "TypeFamilyDependencies"
+ LangExt.TypeInType -> "TypeInType" -- Deprecated
+ LangExt.OverloadedStrings -> "OverloadedStrings"
+ LangExt.OverloadedLists -> "OverloadedLists"
+ LangExt.NumDecimals -> "NumDecimals"
+ LangExt.DisambiguateRecordFields -> "DisambiguateRecordFields"
+ LangExt.RecordWildCards -> "RecordWildCards"
+ LangExt.NamedFieldPuns -> "NamedFieldPuns"
+ LangExt.ViewPatterns -> "ViewPatterns"
+ LangExt.GADTs -> "GADTs"
+ LangExt.GADTSyntax -> "GADTSyntax"
+ LangExt.NPlusKPatterns -> "NPlusKPatterns"
+ LangExt.DoAndIfThenElse -> "DoAndIfThenElse"
+ LangExt.BlockArguments -> "BlockArguments"
+ LangExt.RebindableSyntax -> "RebindableSyntax"
+ LangExt.ConstraintKinds -> "ConstraintKinds"
+ LangExt.PolyKinds -> "PolyKinds" -- Kind polymorphism
+ LangExt.DataKinds -> "DataKinds" -- Datatype promotion
+ LangExt.TypeData -> "TypeData" -- allow @type data@ definitions
+ LangExt.InstanceSigs -> "InstanceSigs"
+ LangExt.ApplicativeDo -> "ApplicativeDo"
+ LangExt.LinearTypes -> "LinearTypes"
+ LangExt.RequiredTypeArguments -> "RequiredTypeArguments" -- Visible forall (VDQ) in types of terms
+
+ LangExt.StandaloneDeriving -> "StandaloneDeriving"
+ LangExt.DeriveDataTypeable -> "DeriveDataTypeable"
+ LangExt.AutoDeriveTypeable -> "AutoDeriveTypeable" -- Automatic derivation of Typeable
+ LangExt.DeriveFunctor -> "DeriveFunctor"
+ LangExt.DeriveTraversable -> "DeriveTraversable"
+ LangExt.DeriveFoldable -> "DeriveFoldable"
+ LangExt.DeriveGeneric -> "DeriveGeneric" -- Allow deriving Generic/1
+ LangExt.DefaultSignatures -> "DefaultSignatures" -- Allow extra signatures for defmeths
+ LangExt.DeriveAnyClass -> "DeriveAnyClass" -- Allow deriving any class
+ LangExt.DeriveLift -> "DeriveLift" -- Allow deriving Lift
+ LangExt.DerivingStrategies -> "DerivingStrategies"
+ LangExt.DerivingVia -> "DerivingVia" -- Derive through equal representation
+
+ LangExt.TypeSynonymInstances -> "TypeSynonymInstances"
+ LangExt.FlexibleContexts -> "FlexibleContexts"
+ LangExt.FlexibleInstances -> "FlexibleInstances"
+ LangExt.ConstrainedClassMethods -> "ConstrainedClassMethods"
+ LangExt.MultiParamTypeClasses -> "MultiParamTypeClasses"
+ LangExt.NullaryTypeClasses -> "NullaryTypeClasses"
+ LangExt.FunctionalDependencies -> "FunctionalDependencies"
+ LangExt.UnicodeSyntax -> "UnicodeSyntax"
+ LangExt.ExistentialQuantification -> "ExistentialQuantification"
+ LangExt.MagicHash -> "MagicHash"
+ LangExt.EmptyDataDecls -> "EmptyDataDecls"
+ LangExt.KindSignatures -> "KindSignatures"
+ LangExt.RoleAnnotations -> "RoleAnnotations"
+ LangExt.ParallelListComp -> "ParallelListComp"
+ LangExt.TransformListComp -> "TransformListComp"
+ LangExt.MonadComprehensions -> "MonadComprehensions"
+ LangExt.GeneralizedNewtypeDeriving -> "GeneralizedNewtypeDeriving"
+ LangExt.RecursiveDo -> "RecursiveDo"
+ LangExt.PostfixOperators -> "PostfixOperators"
+ LangExt.TupleSections -> "TupleSections"
+ LangExt.PatternGuards -> "PatternGuards"
+ LangExt.LiberalTypeSynonyms -> "LiberalTypeSynonyms"
+ LangExt.RankNTypes -> "RankNTypes"
+ LangExt.ImpredicativeTypes -> "ImpredicativeTypes"
+ LangExt.TypeOperators -> "TypeOperators"
+ LangExt.ExplicitNamespaces -> "ExplicitNamespaces"
+ LangExt.PackageImports -> "PackageImports"
+ LangExt.ExplicitForAll -> "ExplicitForAll"
+ LangExt.AlternativeLayoutRule -> "AlternativeLayoutRule"
+ LangExt.AlternativeLayoutRuleTransitional -> "AlternativeLayoutRuleTransitional"
+ LangExt.DatatypeContexts -> "DatatypeContexts"
+ LangExt.NondecreasingIndentation -> "NondecreasingIndentation"
+ LangExt.RelaxedLayout -> "RelaxedLayout"
+ LangExt.TraditionalRecordSyntax -> "TraditionalRecordSyntax"
+ LangExt.LambdaCase -> "LambdaCase"
+ LangExt.MultiWayIf -> "MultiWayIf"
+ LangExt.BinaryLiterals -> "BinaryLiterals"
+ LangExt.NegativeLiterals -> "NegativeLiterals"
+ LangExt.HexFloatLiterals -> "HexFloatLiterals"
+ LangExt.DuplicateRecordFields -> "DuplicateRecordFields"
+ LangExt.OverloadedLabels -> "OverloadedLabels"
+ LangExt.EmptyCase -> "EmptyCase"
+ LangExt.PatternSynonyms -> "PatternSynonyms"
+ LangExt.PartialTypeSignatures -> "PartialTypeSignatures"
+ LangExt.NamedWildCards -> "NamedWildCards"
+ LangExt.StaticPointers -> "StaticPointers"
+ LangExt.TypeApplications -> "TypeApplications"
+ LangExt.Strict -> "Strict"
+ LangExt.StrictData -> "StrictData"
+ LangExt.EmptyDataDeriving -> "EmptyDataDeriving"
+ LangExt.NumericUnderscores -> "NumericUnderscores"
+ LangExt.QuantifiedConstraints -> "QuantifiedConstraints"
+ LangExt.StarIsType -> "StarIsType"
+ LangExt.ImportQualifiedPost -> "ImportQualifiedPost"
+ LangExt.CUSKs -> "CUSKs"
+ LangExt.StandaloneKindSignatures -> "StandaloneKindSignatures"
+ LangExt.LexicalNegation -> "LexicalNegation"
+ LangExt.FieldSelectors -> "FieldSelectors"
+ LangExt.OverloadedRecordDot -> "OverloadedRecordDot"
+ LangExt.OverloadedRecordUpdate -> "OverloadedRecordUpdate"
+ LangExt.TypeAbstractions -> "TypeAbstractions"
+ LangExt.ExtendedLiterals -> "ExtendedLiterals"
+ LangExt.ListTuplePuns -> "ListTuplePuns"
-- | Is this extension known by any other names? For example
-- -XGeneralizedNewtypeDeriving is accepted
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5964db258e6526aa9086201ea9a93fd16046ff40
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5964db258e6526aa9086201ea9a93fd16046ff40
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240507/66048ca0/attachment-0001.html>
More information about the ghc-commits
mailing list