module GHC.Driver.Flags
( DumpFlag(..)
, getDumpFlagFrom
, enabledIfVerbose
, GeneralFlag(..)
, Language(..)
, optimisationFlags
, WarningFlag(..)
, warnFlagNames
, warningGroups
, warningHierarchies
, smallestWarningGroups
, standardWarnings
, minusWOpts
, minusWallOpts
, minusWeverythingOpts
, minusWcompatOpts
, unusedBindsFlags
)
where
import GHC.Prelude
import GHC.Utils.Outputable
import GHC.Utils.Binary
import GHC.Data.EnumSet as EnumSet
import Control.DeepSeq
import Control.Monad (guard)
import Data.List.NonEmpty (NonEmpty(..))
import Data.Maybe (fromMaybe,mapMaybe)
data Language = Haskell98 | Haskell2010 | GHC2021
deriving (Language -> Language -> Bool
(Language -> Language -> Bool)
-> (Language -> Language -> Bool) -> Eq Language
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Language -> Language -> Bool
== :: Language -> Language -> Bool
$c/= :: Language -> Language -> Bool
/= :: Language -> Language -> Bool
Eq, Int -> Language
Language -> Int
Language -> [Language]
Language -> Language
Language -> Language -> [Language]
Language -> Language -> Language -> [Language]
(Language -> Language)
-> (Language -> Language)
-> (Int -> Language)
-> (Language -> Int)
-> (Language -> [Language])
-> (Language -> Language -> [Language])
-> (Language -> Language -> [Language])
-> (Language -> Language -> Language -> [Language])
-> Enum Language
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: Language -> Language
succ :: Language -> Language
$cpred :: Language -> Language
pred :: Language -> Language
$ctoEnum :: Int -> Language
toEnum :: Int -> Language
$cfromEnum :: Language -> Int
fromEnum :: Language -> Int
$cenumFrom :: Language -> [Language]
enumFrom :: Language -> [Language]
$cenumFromThen :: Language -> Language -> [Language]
enumFromThen :: Language -> Language -> [Language]
$cenumFromTo :: Language -> Language -> [Language]
enumFromTo :: Language -> Language -> [Language]
$cenumFromThenTo :: Language -> Language -> Language -> [Language]
enumFromThenTo :: Language -> Language -> Language -> [Language]
Enum, Int -> Language -> ShowS
[Language] -> ShowS
Language -> String
(Int -> Language -> ShowS)
-> (Language -> String) -> ([Language] -> ShowS) -> Show Language
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Language -> ShowS
showsPrec :: Int -> Language -> ShowS
$cshow :: Language -> String
show :: Language -> String
$cshowList :: [Language] -> ShowS
showList :: [Language] -> ShowS
Show, Language
Language -> Language -> Bounded Language
forall a. a -> a -> Bounded a
$cminBound :: Language
minBound :: Language
$cmaxBound :: Language
maxBound :: Language
Bounded)
instance Outputable Language where
ppr :: Language -> SDoc
ppr = String -> SDoc
forall doc. IsLine doc => String -> doc
text (String -> SDoc) -> (Language -> String) -> Language -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Language -> String
forall a. Show a => a -> String
show
instance Binary Language where
put_ :: BinHandle -> Language -> IO ()
put_ BinHandle
bh = BinHandle -> Int -> IO ()
forall a. Binary a => BinHandle -> a -> IO ()
put_ BinHandle
bh (Int -> IO ()) -> (Language -> Int) -> Language -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Language -> Int
forall a. Enum a => a -> Int
fromEnum
get :: BinHandle -> IO Language
get BinHandle
bh = Int -> Language
forall a. Enum a => Int -> a
toEnum (Int -> Language) -> IO Int -> IO Language
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> BinHandle -> IO Int
forall a. Binary a => BinHandle -> IO a
get BinHandle
bh
instance NFData Language where
rnf :: Language -> ()
rnf Language
x = Language
x Language -> () -> ()
forall a b. a -> b -> b
`seq` ()
data DumpFlag
= Opt_D_dump_cmm
| Opt_D_dump_cmm_from_stg
| Opt_D_dump_cmm_raw
| Opt_D_dump_cmm_verbose_by_proc
| Opt_D_dump_cmm_verbose
| Opt_D_dump_cmm_cfg
| Opt_D_dump_cmm_cbe
| Opt_D_dump_cmm_switch
| Opt_D_dump_cmm_proc
| Opt_D_dump_cmm_sp
| Opt_D_dump_cmm_sink
| Opt_D_dump_cmm_caf
| Opt_D_dump_cmm_procmap
| Opt_D_dump_cmm_split
| Opt_D_dump_cmm_info
| Opt_D_dump_cmm_cps
| Opt_D_dump_cmm_thread_sanitizer
| Opt_D_dump_cfg_weights
| Opt_D_dump_asm
| Opt_D_dump_asm_native
| Opt_D_dump_asm_liveness
| Opt_D_dump_asm_regalloc
| Opt_D_dump_asm_regalloc_stages
| Opt_D_dump_asm_conflicts
| Opt_D_dump_asm_stats
| Opt_D_dump_c_backend
| Opt_D_dump_llvm
| Opt_D_dump_js
| Opt_D_dump_core_stats
| Opt_D_dump_deriv
| Opt_D_dump_ds
| Opt_D_dump_ds_preopt
| Opt_D_dump_foreign
| Opt_D_dump_inlinings
| Opt_D_dump_verbose_inlinings
| Opt_D_dump_rule_firings
| Opt_D_dump_rule_rewrites
| Opt_D_dump_simpl_trace
| Opt_D_dump_occur_anal
| Opt_D_dump_parsed
| Opt_D_dump_parsed_ast
| Opt_D_dump_rn
| Opt_D_dump_rn_ast
| Opt_D_dump_simpl
| Opt_D_dump_simpl_iterations
| Opt_D_dump_spec
| Opt_D_dump_prep
| Opt_D_dump_late_cc
| Opt_D_dump_stg_from_core
| Opt_D_dump_stg_unarised
| Opt_D_dump_stg_cg
| Opt_D_dump_stg_tags
| Opt_D_dump_stg_final
| Opt_D_dump_call_arity
| Opt_D_dump_exitify
| Opt_D_dump_stranal
| Opt_D_dump_str_signatures
| Opt_D_dump_cpranal
| Opt_D_dump_cpr_signatures
| Opt_D_dump_tc
| Opt_D_dump_tc_ast
| Opt_D_dump_hie
| Opt_D_dump_types
| Opt_D_dump_rules
| Opt_D_dump_cse
| Opt_D_dump_worker_wrapper
| Opt_D_dump_rn_trace
| Opt_D_dump_rn_stats
| Opt_D_dump_opt_cmm
| Opt_D_dump_simpl_stats
| Opt_D_dump_cs_trace
| Opt_D_dump_tc_trace
| Opt_D_dump_ec_trace
| Opt_D_dump_if_trace
| Opt_D_dump_splices
| Opt_D_th_dec_file
| Opt_D_dump_BCOs
| Opt_D_dump_ticked
| Opt_D_dump_rtti
| Opt_D_source_stats
| Opt_D_verbose_stg2stg
| Opt_D_dump_hi
| Opt_D_dump_hi_diffs
| Opt_D_dump_mod_cycles
| Opt_D_dump_mod_map
| Opt_D_dump_timings
| Opt_D_dump_view_pattern_commoning
| Opt_D_verbose_core2core
| Opt_D_dump_debug
| Opt_D_dump_json
| Opt_D_ppr_debug
| Opt_D_no_debug_output
| Opt_D_dump_faststrings
| Opt_D_faststring_stats
deriving (DumpFlag -> DumpFlag -> Bool
(DumpFlag -> DumpFlag -> Bool)
-> (DumpFlag -> DumpFlag -> Bool) -> Eq DumpFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DumpFlag -> DumpFlag -> Bool
== :: DumpFlag -> DumpFlag -> Bool
$c/= :: DumpFlag -> DumpFlag -> Bool
/= :: DumpFlag -> DumpFlag -> Bool
Eq, Int -> DumpFlag -> ShowS
[DumpFlag] -> ShowS
DumpFlag -> String
(Int -> DumpFlag -> ShowS)
-> (DumpFlag -> String) -> ([DumpFlag] -> ShowS) -> Show DumpFlag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DumpFlag -> ShowS
showsPrec :: Int -> DumpFlag -> ShowS
$cshow :: DumpFlag -> String
show :: DumpFlag -> String
$cshowList :: [DumpFlag] -> ShowS
showList :: [DumpFlag] -> ShowS
Show, Int -> DumpFlag
DumpFlag -> Int
DumpFlag -> [DumpFlag]
DumpFlag -> DumpFlag
DumpFlag -> DumpFlag -> [DumpFlag]
DumpFlag -> DumpFlag -> DumpFlag -> [DumpFlag]
(DumpFlag -> DumpFlag)
-> (DumpFlag -> DumpFlag)
-> (Int -> DumpFlag)
-> (DumpFlag -> Int)
-> (DumpFlag -> [DumpFlag])
-> (DumpFlag -> DumpFlag -> [DumpFlag])
-> (DumpFlag -> DumpFlag -> [DumpFlag])
-> (DumpFlag -> DumpFlag -> DumpFlag -> [DumpFlag])
-> Enum DumpFlag
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: DumpFlag -> DumpFlag
succ :: DumpFlag -> DumpFlag
$cpred :: DumpFlag -> DumpFlag
pred :: DumpFlag -> DumpFlag
$ctoEnum :: Int -> DumpFlag
toEnum :: Int -> DumpFlag
$cfromEnum :: DumpFlag -> Int
fromEnum :: DumpFlag -> Int
$cenumFrom :: DumpFlag -> [DumpFlag]
enumFrom :: DumpFlag -> [DumpFlag]
$cenumFromThen :: DumpFlag -> DumpFlag -> [DumpFlag]
enumFromThen :: DumpFlag -> DumpFlag -> [DumpFlag]
$cenumFromTo :: DumpFlag -> DumpFlag -> [DumpFlag]
enumFromTo :: DumpFlag -> DumpFlag -> [DumpFlag]
$cenumFromThenTo :: DumpFlag -> DumpFlag -> DumpFlag -> [DumpFlag]
enumFromThenTo :: DumpFlag -> DumpFlag -> DumpFlag -> [DumpFlag]
Enum)
getDumpFlagFrom
:: (a -> Int)
-> (a -> EnumSet DumpFlag)
-> DumpFlag -> a -> Bool
getDumpFlagFrom :: forall a.
(a -> Int) -> (a -> EnumSet DumpFlag) -> DumpFlag -> a -> Bool
getDumpFlagFrom a -> Int
getVerbosity a -> EnumSet DumpFlag
getFlags DumpFlag
f a
x
= (DumpFlag
f DumpFlag -> EnumSet DumpFlag -> Bool
forall a. Enum a => a -> EnumSet a -> Bool
`EnumSet.member` a -> EnumSet DumpFlag
getFlags a
x)
Bool -> Bool -> Bool
|| (a -> Int
getVerbosity a
x Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
4 Bool -> Bool -> Bool
&& DumpFlag -> Bool
enabledIfVerbose DumpFlag
f)
enabledIfVerbose :: DumpFlag -> Bool
enabledIfVerbose :: DumpFlag -> Bool
enabledIfVerbose DumpFlag
Opt_D_dump_tc_trace = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_rn_trace = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_cs_trace = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_if_trace = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_tc = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_rn = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_rn_stats = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_hi_diffs = Bool
False
enabledIfVerbose DumpFlag
Opt_D_verbose_core2core = Bool
False
enabledIfVerbose DumpFlag
Opt_D_verbose_stg2stg = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_splices = Bool
False
enabledIfVerbose DumpFlag
Opt_D_th_dec_file = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_rule_firings = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_rule_rewrites = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_simpl_trace = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_rtti = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_inlinings = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_verbose_inlinings = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_core_stats = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_asm_stats = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_types = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_simpl_iterations = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_ticked = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_view_pattern_commoning = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_mod_cycles = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_mod_map = Bool
False
enabledIfVerbose DumpFlag
Opt_D_dump_ec_trace = Bool
False
enabledIfVerbose DumpFlag
_ = Bool
True
data GeneralFlag
= Opt_DumpToFile
| Opt_DumpWithWays
| Opt_D_dump_minimal_imports
| Opt_DoCoreLinting
| Opt_DoLinearCoreLinting
| Opt_DoStgLinting
| Opt_DoCmmLinting
| Opt_DoAsmLinting
| Opt_DoAnnotationLinting
| Opt_DoBoundsChecking
| Opt_NoLlvmMangler
| Opt_FastLlvm
| Opt_NoTypeableBinds
| Opt_DistinctConstructorTables
| Opt_InfoTableMap
| Opt_WarnIsError
| Opt_ShowWarnGroups
| Opt_HideSourcePaths
| Opt_PrintExplicitForalls
| Opt_PrintExplicitKinds
| Opt_PrintExplicitCoercions
| Opt_PrintExplicitRuntimeReps
| Opt_PrintEqualityRelations
| Opt_PrintAxiomIncomps
| Opt_PrintUnicodeSyntax
| Opt_PrintExpandedSynonyms
| Opt_PrintPotentialInstances
| Opt_PrintRedundantPromotionTicks
| Opt_PrintTypecheckerElaboration
| Opt_CallArity
| Opt_Exitification
| Opt_Strictness
| Opt_LateDmdAnal
| Opt_KillAbsence
| Opt_KillOneShot
| Opt_FullLaziness
| Opt_FloatIn
| Opt_LocalFloatOut
| Opt_LocalFloatOutTopLevel
| Opt_LateSpecialise
| Opt_Specialise
| Opt_SpecialiseAggressively
| Opt_CrossModuleSpecialise
| Opt_InlineGenerics
| Opt_InlineGenericsAggressively
| Opt_StaticArgumentTransformation
| Opt_CSE
| Opt_StgCSE
| Opt_StgLiftLams
| Opt_LiberateCase
| Opt_SpecConstr
| Opt_SpecConstrKeen
| Opt_DoLambdaEtaExpansion
| Opt_IgnoreAsserts
| Opt_DoEtaReduction
| Opt_CaseMerge
| Opt_CaseFolding
| Opt_UnboxStrictFields
| Opt_UnboxSmallStrictFields
| Opt_DictsCheap
| Opt_EnableRewriteRules
| Opt_EnableThSpliceWarnings
| Opt_RegsGraph
| Opt_RegsIterative
| Opt_PedanticBottoms
| Opt_LlvmTBAA
| Opt_LlvmFillUndefWithGarbage
| Opt_IrrefutableTuples
| Opt_CmmSink
| Opt_CmmStaticPred
| Opt_CmmElimCommonBlocks
| Opt_CmmControlFlow
| Opt_AsmShortcutting
| Opt_OmitYields
| Opt_FunToThunk
| Opt_DictsStrict
| Opt_DmdTxDictSel
| Opt_Loopification
| Opt_CfgBlocklayout
| Opt_WeightlessBlocklayout
| Opt_CprAnal
| Opt_WorkerWrapper
| Opt_WorkerWrapperUnlift
| Opt_SolveConstantDicts
| Opt_AlignmentSanitisation
| Opt_CatchNonexhaustiveCases
| Opt_NumConstantFolding
| Opt_CoreConstantFolding
| Opt_FastPAPCalls
| Opt_DoTagInferenceChecks
| Opt_SimplPreInlining
| Opt_IgnoreInterfacePragmas
| Opt_OmitInterfacePragmas
| Opt_ExposeAllUnfoldings
| Opt_WriteInterface
| Opt_WriteHie
| Opt_AutoSccsOnIndividualCafs
| Opt_ProfCountEntries
| Opt_ProfLateInlineCcs
| Opt_ProfLateCcs
| Opt_ProfManualCcs
| Opt_Pp
| Opt_ForceRecomp
| Opt_IgnoreOptimChanges
| Opt_IgnoreHpcChanges
| Opt_ExcessPrecision
| Opt_EagerBlackHoling
| Opt_NoHsMain
| Opt_SplitSections
| Opt_StgStats
| Opt_HideAllPackages
| Opt_HideAllPluginPackages
| Opt_PrintBindResult
| Opt_Haddock
| Opt_HaddockOptions
| Opt_BreakOnException
| Opt_BreakOnError
| Opt_PrintEvldWithShow
| Opt_PrintBindContents
| Opt_GenManifest
| Opt_EmbedManifest
| Opt_SharedImplib
| Opt_BuildingCabalPackage
| Opt_IgnoreDotGhci
| Opt_GhciSandbox
| Opt_GhciHistory
| Opt_GhciLeakCheck
| Opt_ValidateHie
| Opt_LocalGhciHistory
| Opt_NoIt
| Opt_HelpfulErrors
| Opt_DeferTypeErrors
| Opt_DeferTypedHoles
| Opt_DeferOutOfScopeVariables
| Opt_PIC
| Opt_PIE
| Opt_PICExecutable
| Opt_ExternalDynamicRefs
| Opt_Ticky
| Opt_Ticky_Allocd
| Opt_Ticky_LNE
| Opt_Ticky_Dyn_Thunk
| Opt_Ticky_Tag
| Opt_Ticky_AP
| Opt_CmmThreadSanitizer
| Opt_RPath
| Opt_RelativeDynlibPaths
| Opt_CompactUnwind
| Opt_Hpc
| Opt_FamAppCache
| Opt_ExternalInterpreter
| Opt_OptimalApplicativeDo
| Opt_VersionMacros
| Opt_WholeArchiveHsLibs
| Opt_SingleLibFolder
| Opt_ExposeInternalSymbols
| Opt_KeepCAFs
| Opt_KeepGoing
| Opt_ByteCode
| Opt_ByteCodeAndObjectCode
| Opt_LinkRts
| Opt_ErrorSpans
| Opt_DeferDiagnostics
| Opt_DiagnosticsShowCaret
| Opt_PprCaseAsLet
| Opt_PprShowTicks
| Opt_ShowHoleConstraints
| Opt_ShowValidHoleFits
| Opt_SortValidHoleFits
| Opt_SortBySizeHoleFits
| Opt_SortBySubsumHoleFits
| Opt_AbstractRefHoleFits
| Opt_UnclutterValidHoleFits
| Opt_ShowTypeAppOfHoleFits
| Opt_ShowTypeAppVarsOfHoleFits
| Opt_ShowDocsOfHoleFits
| Opt_ShowTypeOfHoleFits
| Opt_ShowProvOfHoleFits
| Opt_ShowMatchesOfHoleFits
| Opt_ShowLoadedModules
| Opt_HexWordLiterals
| Opt_SuppressCoercions
| Opt_SuppressCoercionTypes
| Opt_SuppressVarKinds
| Opt_SuppressModulePrefixes
| Opt_SuppressTypeApplications
| Opt_SuppressIdInfo
| Opt_SuppressUnfoldings
| Opt_SuppressTypeSignatures
| Opt_SuppressUniques
| Opt_SuppressStgExts
| Opt_SuppressStgReps
| Opt_SuppressTicks
| Opt_SuppressTimestamps
| Opt_SuppressCoreSizes
| Opt_ShowErrorContext
| Opt_AutoLinkPackages
| Opt_ImplicitImportQualified
| Opt_KeepHscppFiles
| Opt_KeepHiDiffs
| Opt_KeepHcFiles
| Opt_KeepSFiles
| Opt_KeepTmpFiles
| Opt_KeepRawTokenStream
| Opt_KeepLlvmFiles
| Opt_KeepHiFiles
| Opt_KeepOFiles
| Opt_BuildDynamicToo
| Opt_WriteIfSimplifiedCore
| Opt_UseBytecodeRatherThanObjects
| Opt_DistrustAllPackages
| Opt_PackageTrust
| Opt_PluginTrustworthy
| Opt_G_NoStateHack
| Opt_G_NoOptCoercion
deriving (GeneralFlag -> GeneralFlag -> Bool
(GeneralFlag -> GeneralFlag -> Bool)
-> (GeneralFlag -> GeneralFlag -> Bool) -> Eq GeneralFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GeneralFlag -> GeneralFlag -> Bool
== :: GeneralFlag -> GeneralFlag -> Bool
$c/= :: GeneralFlag -> GeneralFlag -> Bool
/= :: GeneralFlag -> GeneralFlag -> Bool
Eq, Int -> GeneralFlag -> ShowS
[GeneralFlag] -> ShowS
GeneralFlag -> String
(Int -> GeneralFlag -> ShowS)
-> (GeneralFlag -> String)
-> ([GeneralFlag] -> ShowS)
-> Show GeneralFlag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GeneralFlag -> ShowS
showsPrec :: Int -> GeneralFlag -> ShowS
$cshow :: GeneralFlag -> String
show :: GeneralFlag -> String
$cshowList :: [GeneralFlag] -> ShowS
showList :: [GeneralFlag] -> ShowS
Show, Int -> GeneralFlag
GeneralFlag -> Int
GeneralFlag -> [GeneralFlag]
GeneralFlag -> GeneralFlag
GeneralFlag -> GeneralFlag -> [GeneralFlag]
GeneralFlag -> GeneralFlag -> GeneralFlag -> [GeneralFlag]
(GeneralFlag -> GeneralFlag)
-> (GeneralFlag -> GeneralFlag)
-> (Int -> GeneralFlag)
-> (GeneralFlag -> Int)
-> (GeneralFlag -> [GeneralFlag])
-> (GeneralFlag -> GeneralFlag -> [GeneralFlag])
-> (GeneralFlag -> GeneralFlag -> [GeneralFlag])
-> (GeneralFlag -> GeneralFlag -> GeneralFlag -> [GeneralFlag])
-> Enum GeneralFlag
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: GeneralFlag -> GeneralFlag
succ :: GeneralFlag -> GeneralFlag
$cpred :: GeneralFlag -> GeneralFlag
pred :: GeneralFlag -> GeneralFlag
$ctoEnum :: Int -> GeneralFlag
toEnum :: Int -> GeneralFlag
$cfromEnum :: GeneralFlag -> Int
fromEnum :: GeneralFlag -> Int
$cenumFrom :: GeneralFlag -> [GeneralFlag]
enumFrom :: GeneralFlag -> [GeneralFlag]
$cenumFromThen :: GeneralFlag -> GeneralFlag -> [GeneralFlag]
enumFromThen :: GeneralFlag -> GeneralFlag -> [GeneralFlag]
$cenumFromTo :: GeneralFlag -> GeneralFlag -> [GeneralFlag]
enumFromTo :: GeneralFlag -> GeneralFlag -> [GeneralFlag]
$cenumFromThenTo :: GeneralFlag -> GeneralFlag -> GeneralFlag -> [GeneralFlag]
enumFromThenTo :: GeneralFlag -> GeneralFlag -> GeneralFlag -> [GeneralFlag]
Enum)
optimisationFlags :: EnumSet GeneralFlag
optimisationFlags :: EnumSet GeneralFlag
optimisationFlags = [GeneralFlag] -> EnumSet GeneralFlag
forall a. Enum a => [a] -> EnumSet a
EnumSet.fromList
[ GeneralFlag
Opt_CallArity
, GeneralFlag
Opt_Strictness
, GeneralFlag
Opt_LateDmdAnal
, GeneralFlag
Opt_KillAbsence
, GeneralFlag
Opt_KillOneShot
, GeneralFlag
Opt_FullLaziness
, GeneralFlag
Opt_FloatIn
, GeneralFlag
Opt_LateSpecialise
, GeneralFlag
Opt_Specialise
, GeneralFlag
Opt_SpecialiseAggressively
, GeneralFlag
Opt_CrossModuleSpecialise
, GeneralFlag
Opt_StaticArgumentTransformation
, GeneralFlag
Opt_CSE
, GeneralFlag
Opt_StgCSE
, GeneralFlag
Opt_StgLiftLams
, GeneralFlag
Opt_LiberateCase
, GeneralFlag
Opt_SpecConstr
, GeneralFlag
Opt_SpecConstrKeen
, GeneralFlag
Opt_DoLambdaEtaExpansion
, GeneralFlag
Opt_IgnoreAsserts
, GeneralFlag
Opt_DoEtaReduction
, GeneralFlag
Opt_CaseMerge
, GeneralFlag
Opt_CaseFolding
, GeneralFlag
Opt_UnboxStrictFields
, GeneralFlag
Opt_UnboxSmallStrictFields
, GeneralFlag
Opt_DictsCheap
, GeneralFlag
Opt_EnableRewriteRules
, GeneralFlag
Opt_RegsGraph
, GeneralFlag
Opt_RegsIterative
, GeneralFlag
Opt_PedanticBottoms
, GeneralFlag
Opt_LlvmTBAA
, GeneralFlag
Opt_LlvmFillUndefWithGarbage
, GeneralFlag
Opt_IrrefutableTuples
, GeneralFlag
Opt_CmmSink
, GeneralFlag
Opt_CmmElimCommonBlocks
, GeneralFlag
Opt_AsmShortcutting
, GeneralFlag
Opt_OmitYields
, GeneralFlag
Opt_FunToThunk
, GeneralFlag
Opt_DictsStrict
, GeneralFlag
Opt_DmdTxDictSel
, GeneralFlag
Opt_Loopification
, GeneralFlag
Opt_CfgBlocklayout
, GeneralFlag
Opt_WeightlessBlocklayout
, GeneralFlag
Opt_CprAnal
, GeneralFlag
Opt_WorkerWrapper
, GeneralFlag
Opt_WorkerWrapperUnlift
, GeneralFlag
Opt_SolveConstantDicts
, GeneralFlag
Opt_CatchNonexhaustiveCases
, GeneralFlag
Opt_IgnoreAsserts
]
data WarningFlag =
Opt_WarnDuplicateExports
| Opt_WarnDuplicateConstraints
| Opt_WarnRedundantConstraints
| Opt_WarnHiShadows
| Opt_WarnImplicitPrelude
| Opt_WarnIncompletePatterns
| Opt_WarnIncompleteUniPatterns
| Opt_WarnIncompletePatternsRecUpd
| Opt_WarnOverflowedLiterals
| Opt_WarnEmptyEnumerations
| Opt_WarnMissingFields
| Opt_WarnMissingImportList
| Opt_WarnMissingMethods
| Opt_WarnMissingSignatures
| Opt_WarnMissingLocalSignatures
| Opt_WarnNameShadowing
| Opt_WarnOverlappingPatterns
| Opt_WarnTypeDefaults
| Opt_WarnMonomorphism
| Opt_WarnUnusedTopBinds
| Opt_WarnUnusedLocalBinds
| Opt_WarnUnusedPatternBinds
| Opt_WarnUnusedImports
| Opt_WarnUnusedMatches
| Opt_WarnUnusedTypePatterns
| Opt_WarnUnusedForalls
| Opt_WarnUnusedRecordWildcards
| Opt_WarnRedundantBangPatterns
| Opt_WarnRedundantRecordWildcards
| Opt_WarnWarningsDeprecations
| Opt_WarnDeprecatedFlags
| Opt_WarnMissingMonadFailInstances
| Opt_WarnSemigroup
| Opt_WarnDodgyExports
| Opt_WarnDodgyImports
| Opt_WarnOrphans
| Opt_WarnAutoOrphans
| Opt_WarnIdentities
| Opt_WarnTabs
| Opt_WarnUnrecognisedPragmas
| Opt_WarnMisplacedPragmas
| Opt_WarnDodgyForeignImports
| Opt_WarnUnusedDoBind
| Opt_WarnWrongDoBind
| Opt_WarnAlternativeLayoutRuleTransitional
| Opt_WarnUnsafe
| Opt_WarnSafe
| Opt_WarnTrustworthySafe
| Opt_WarnMissedSpecs
| Opt_WarnAllMissedSpecs
| Opt_WarnUnsupportedCallingConventions
| Opt_WarnUnsupportedLlvmVersion
|
| Opt_WarnInlineRuleShadowing
| Opt_WarnTypedHoles
| Opt_WarnPartialTypeSignatures
| Opt_WarnMissingExportedSignatures
| Opt_WarnUntickedPromotedConstructors
| Opt_WarnDerivingTypeable
| Opt_WarnDeferredTypeErrors
| Opt_WarnDeferredOutOfScopeVariables
| Opt_WarnNonCanonicalMonadInstances
| Opt_WarnNonCanonicalMonadFailInstances
| Opt_WarnNonCanonicalMonoidInstances
| Opt_WarnMissingPatternSynonymSignatures
| Opt_WarnUnrecognisedWarningFlags
| Opt_WarnSimplifiableClassConstraints
| Opt_WarnCPPUndef
| Opt_WarnUnbangedStrictPatterns
| Opt_WarnMissingHomeModules
| Opt_WarnPartialFields
| Opt_WarnMissingExportList
| Opt_WarnInaccessibleCode
| Opt_WarnStarIsType
| Opt_WarnStarBinder
| Opt_WarnImplicitKindVars
| Opt_WarnSpaceAfterBang
| Opt_WarnMissingDerivingStrategies
| Opt_WarnPrepositiveQualifiedModule
| Opt_WarnUnusedPackages
| Opt_WarnInferredSafeImports
| Opt_WarnMissingSafeHaskellMode
| Opt_WarnCompatUnqualifiedImports
| Opt_WarnDerivingDefaults
| Opt_WarnInvalidHaddock
| Opt_WarnOperatorWhitespaceExtConflict
| Opt_WarnOperatorWhitespace
| Opt_WarnAmbiguousFields
| Opt_WarnImplicitLift
| Opt_WarnMissingKindSignatures
| Opt_WarnMissingExportedPatternSynonymSignatures
| Opt_WarnRedundantStrictnessFlags
| Opt_WarnForallIdentifier
| Opt_WarnUnicodeBidirectionalFormatCharacters
| Opt_WarnGADTMonoLocalBinds
| Opt_WarnTypeEqualityOutOfScope
| Opt_WarnTypeEqualityRequiresOperators
deriving (WarningFlag -> WarningFlag -> Bool
(WarningFlag -> WarningFlag -> Bool)
-> (WarningFlag -> WarningFlag -> Bool) -> Eq WarningFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WarningFlag -> WarningFlag -> Bool
== :: WarningFlag -> WarningFlag -> Bool
$c/= :: WarningFlag -> WarningFlag -> Bool
/= :: WarningFlag -> WarningFlag -> Bool
Eq, Eq WarningFlag
Eq WarningFlag =>
(WarningFlag -> WarningFlag -> Ordering)
-> (WarningFlag -> WarningFlag -> Bool)
-> (WarningFlag -> WarningFlag -> Bool)
-> (WarningFlag -> WarningFlag -> Bool)
-> (WarningFlag -> WarningFlag -> Bool)
-> (WarningFlag -> WarningFlag -> WarningFlag)
-> (WarningFlag -> WarningFlag -> WarningFlag)
-> Ord WarningFlag
WarningFlag -> WarningFlag -> Bool
WarningFlag -> WarningFlag -> Ordering
WarningFlag -> WarningFlag -> WarningFlag
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: WarningFlag -> WarningFlag -> Ordering
compare :: WarningFlag -> WarningFlag -> Ordering
$c< :: WarningFlag -> WarningFlag -> Bool
< :: WarningFlag -> WarningFlag -> Bool
$c<= :: WarningFlag -> WarningFlag -> Bool
<= :: WarningFlag -> WarningFlag -> Bool
$c> :: WarningFlag -> WarningFlag -> Bool
> :: WarningFlag -> WarningFlag -> Bool
$c>= :: WarningFlag -> WarningFlag -> Bool
>= :: WarningFlag -> WarningFlag -> Bool
$cmax :: WarningFlag -> WarningFlag -> WarningFlag
max :: WarningFlag -> WarningFlag -> WarningFlag
$cmin :: WarningFlag -> WarningFlag -> WarningFlag
min :: WarningFlag -> WarningFlag -> WarningFlag
Ord, Int -> WarningFlag -> ShowS
[WarningFlag] -> ShowS
WarningFlag -> String
(Int -> WarningFlag -> ShowS)
-> (WarningFlag -> String)
-> ([WarningFlag] -> ShowS)
-> Show WarningFlag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WarningFlag -> ShowS
showsPrec :: Int -> WarningFlag -> ShowS
$cshow :: WarningFlag -> String
show :: WarningFlag -> String
$cshowList :: [WarningFlag] -> ShowS
showList :: [WarningFlag] -> ShowS
Show, Int -> WarningFlag
WarningFlag -> Int
WarningFlag -> [WarningFlag]
WarningFlag -> WarningFlag
WarningFlag -> WarningFlag -> [WarningFlag]
WarningFlag -> WarningFlag -> WarningFlag -> [WarningFlag]
(WarningFlag -> WarningFlag)
-> (WarningFlag -> WarningFlag)
-> (Int -> WarningFlag)
-> (WarningFlag -> Int)
-> (WarningFlag -> [WarningFlag])
-> (WarningFlag -> WarningFlag -> [WarningFlag])
-> (WarningFlag -> WarningFlag -> [WarningFlag])
-> (WarningFlag -> WarningFlag -> WarningFlag -> [WarningFlag])
-> Enum WarningFlag
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: WarningFlag -> WarningFlag
succ :: WarningFlag -> WarningFlag
$cpred :: WarningFlag -> WarningFlag
pred :: WarningFlag -> WarningFlag
$ctoEnum :: Int -> WarningFlag
toEnum :: Int -> WarningFlag
$cfromEnum :: WarningFlag -> Int
fromEnum :: WarningFlag -> Int
$cenumFrom :: WarningFlag -> [WarningFlag]
enumFrom :: WarningFlag -> [WarningFlag]
$cenumFromThen :: WarningFlag -> WarningFlag -> [WarningFlag]
enumFromThen :: WarningFlag -> WarningFlag -> [WarningFlag]
$cenumFromTo :: WarningFlag -> WarningFlag -> [WarningFlag]
enumFromTo :: WarningFlag -> WarningFlag -> [WarningFlag]
$cenumFromThenTo :: WarningFlag -> WarningFlag -> WarningFlag -> [WarningFlag]
enumFromThenTo :: WarningFlag -> WarningFlag -> WarningFlag -> [WarningFlag]
Enum)
warnFlagNames :: WarningFlag -> NonEmpty String
warnFlagNames :: WarningFlag -> NonEmpty String
warnFlagNames WarningFlag
wflag = case WarningFlag
wflag of
WarningFlag
Opt_WarnAlternativeLayoutRuleTransitional -> String
"alternative-layout-rule-transitional" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnAmbiguousFields -> String
"ambiguous-fields" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnAutoOrphans -> String
"auto-orphans" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnCPPUndef -> String
"cpp-undef" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnbangedStrictPatterns -> String
"unbanged-strict-patterns" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnDeferredTypeErrors -> String
"deferred-type-errors" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnDeferredOutOfScopeVariables -> String
"deferred-out-of-scope-variables" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnWarningsDeprecations -> String
"deprecations" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| [String
"warnings-deprecations"]
WarningFlag
Opt_WarnDeprecatedFlags -> String
"deprecated-flags" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnDerivingDefaults -> String
"deriving-defaults" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnDerivingTypeable -> String
"deriving-typeable" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnDodgyExports -> String
"dodgy-exports" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnDodgyForeignImports -> String
"dodgy-foreign-imports" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnDodgyImports -> String
"dodgy-imports" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnEmptyEnumerations -> String
"empty-enumerations" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnDuplicateConstraints -> String
"duplicate-constraints" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnRedundantConstraints -> String
"redundant-constraints" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnDuplicateExports -> String
"duplicate-exports" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnHiShadows -> String
"hi-shadowing" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnInaccessibleCode -> String
"inaccessible-code" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnImplicitPrelude -> String
"implicit-prelude" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnImplicitKindVars -> String
"implicit-kind-vars" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnIncompletePatterns -> String
"incomplete-patterns" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnIncompletePatternsRecUpd -> String
"incomplete-record-updates" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnIncompleteUniPatterns -> String
"incomplete-uni-patterns" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnInlineRuleShadowing -> String
"inline-rule-shadowing" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnIdentities -> String
"identities" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingFields -> String
"missing-fields" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingImportList -> String
"missing-import-lists" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingExportList -> String
"missing-export-lists" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingLocalSignatures -> String
"missing-local-signatures" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingMethods -> String
"missing-methods" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingMonadFailInstances -> String
"missing-monadfail-instances" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnSemigroup -> String
"semigroup" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingSignatures -> String
"missing-signatures" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingKindSignatures -> String
"missing-kind-signatures" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingExportedSignatures -> String
"missing-exported-signatures" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMonomorphism -> String
"monomorphism-restriction" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnNameShadowing -> String
"name-shadowing" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnNonCanonicalMonadInstances -> String
"noncanonical-monad-instances" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnNonCanonicalMonadFailInstances -> String
"noncanonical-monadfail-instances" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnNonCanonicalMonoidInstances -> String
"noncanonical-monoid-instances" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnOrphans -> String
"orphans" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnOverflowedLiterals -> String
"overflowed-literals" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnOverlappingPatterns -> String
"overlapping-patterns" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissedSpecs -> String
"missed-specialisations" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| [String
"missed-specializations"]
WarningFlag
Opt_WarnAllMissedSpecs -> String
"all-missed-specialisations" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| [String
"all-missed-specializations"]
WarningFlag
Opt_WarnSafe -> String
"safe" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnTrustworthySafe -> String
"trustworthy-safe" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnInferredSafeImports -> String
"inferred-safe-imports" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingSafeHaskellMode -> String
"missing-safe-haskell-mode" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnTabs -> String
"tabs" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnTypeDefaults -> String
"type-defaults" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnTypedHoles -> String
"typed-holes" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnPartialTypeSignatures -> String
"partial-type-signatures" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnrecognisedPragmas -> String
"unrecognised-pragmas" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMisplacedPragmas -> String
"misplaced-pragmas" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnsafe -> String
"unsafe" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnsupportedCallingConventions -> String
"unsupported-calling-conventions" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnsupportedLlvmVersion -> String
"unsupported-llvm-version" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissedExtraSharedLib -> String
"missed-extra-shared-lib" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUntickedPromotedConstructors -> String
"unticked-promoted-constructors" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnusedDoBind -> String
"unused-do-bind" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnusedForalls -> String
"unused-foralls" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnusedImports -> String
"unused-imports" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnusedLocalBinds -> String
"unused-local-binds" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnusedMatches -> String
"unused-matches" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnusedPatternBinds -> String
"unused-pattern-binds" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnusedTopBinds -> String
"unused-top-binds" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnusedTypePatterns -> String
"unused-type-patterns" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnusedRecordWildcards -> String
"unused-record-wildcards" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnRedundantBangPatterns -> String
"redundant-bang-patterns" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnRedundantRecordWildcards -> String
"redundant-record-wildcards" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnRedundantStrictnessFlags -> String
"redundant-strictness-flags" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnWrongDoBind -> String
"wrong-do-bind" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingPatternSynonymSignatures -> String
"missing-pattern-synonym-signatures" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingDerivingStrategies -> String
"missing-deriving-strategies" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnSimplifiableClassConstraints -> String
"simplifiable-class-constraints" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingHomeModules -> String
"missing-home-modules" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnrecognisedWarningFlags -> String
"unrecognised-warning-flags" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnStarBinder -> String
"star-binder" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnStarIsType -> String
"star-is-type" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnSpaceAfterBang -> String
"missing-space-after-bang" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnPartialFields -> String
"partial-fields" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnPrepositiveQualifiedModule -> String
"prepositive-qualified-module" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnusedPackages -> String
"unused-packages" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnCompatUnqualifiedImports -> String
"compat-unqualified-imports" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnInvalidHaddock -> String
"invalid-haddock" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnOperatorWhitespaceExtConflict -> String
"operator-whitespace-ext-conflict" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnOperatorWhitespace -> String
"operator-whitespace" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnImplicitLift -> String
"implicit-lift" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnMissingExportedPatternSynonymSignatures -> String
"missing-exported-pattern-synonym-signatures" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnForallIdentifier -> String
"forall-identifier" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnUnicodeBidirectionalFormatCharacters -> String
"unicode-bidirectional-format-characters" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnGADTMonoLocalBinds -> String
"gadt-mono-local-binds" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnTypeEqualityOutOfScope -> String
"type-equality-out-of-scope" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
WarningFlag
Opt_WarnTypeEqualityRequiresOperators -> String
"type-equality-requires-operators" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
:| []
warningGroups :: [(String, [WarningFlag])]
warningGroups :: [(String, [WarningFlag])]
warningGroups =
[ (String
"compat", [WarningFlag]
minusWcompatOpts)
, (String
"unused-binds", [WarningFlag]
unusedBindsFlags)
, (String
"default", [WarningFlag]
standardWarnings)
, (String
"extra", [WarningFlag]
minusWOpts)
, (String
"all", [WarningFlag]
minusWallOpts)
, (String
"everything", [WarningFlag]
minusWeverythingOpts)
]
warningHierarchies :: [[String]]
warningHierarchies :: [[String]]
warningHierarchies = [[String]]
hierarchies [[String]] -> [[String]] -> [[String]]
forall a. [a] -> [a] -> [a]
++ (String -> [String]) -> [String] -> [[String]]
forall a b. (a -> b) -> [a] -> [b]
map (String -> [String] -> [String]
forall a. a -> [a] -> [a]
:[]) [String]
rest
where
hierarchies :: [[String]]
hierarchies = [[String
"default", String
"extra", String
"all"]]
rest :: [String]
rest = (String -> Bool) -> [String] -> [String]
forall a. (a -> Bool) -> [a] -> [a]
filter (String -> [String] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` String
"everything" String -> [String] -> [String]
forall a. a -> [a] -> [a]
: [[String]] -> [String]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [[String]]
hierarchies) ([String] -> [String]) -> [String] -> [String]
forall a b. (a -> b) -> a -> b
$
((String, [WarningFlag]) -> String)
-> [(String, [WarningFlag])] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (String, [WarningFlag]) -> String
forall a b. (a, b) -> a
fst [(String, [WarningFlag])]
warningGroups
smallestWarningGroups :: WarningFlag -> [String]
smallestWarningGroups :: WarningFlag -> [String]
smallestWarningGroups WarningFlag
flag = ([String] -> Maybe String) -> [[String]] -> [String]
forall a b. (a -> Maybe b) -> [a] -> [b]
mapMaybe [String] -> Maybe String
go [[String]]
warningHierarchies where
go :: [String] -> Maybe String
go (String
group:[String]
rest) = Maybe String -> Maybe (Maybe String) -> Maybe String
forall a. a -> Maybe a -> a
fromMaybe ([String] -> Maybe String
go [String]
rest) (Maybe (Maybe String) -> Maybe String)
-> Maybe (Maybe String) -> Maybe String
forall a b. (a -> b) -> a -> b
$ do
[WarningFlag]
flags <- String -> [(String, [WarningFlag])] -> Maybe [WarningFlag]
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup String
group [(String, [WarningFlag])]
warningGroups
Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (WarningFlag
flag WarningFlag -> [WarningFlag] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [WarningFlag]
flags)
Maybe String -> Maybe (Maybe String)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (String -> Maybe String
forall a. a -> Maybe a
Just String
group)
go [] = Maybe String
forall a. Maybe a
Nothing
standardWarnings :: [WarningFlag]
standardWarnings :: [WarningFlag]
standardWarnings
= [ WarningFlag
Opt_WarnOverlappingPatterns,
WarningFlag
Opt_WarnWarningsDeprecations,
WarningFlag
Opt_WarnDeprecatedFlags,
WarningFlag
Opt_WarnDeferredTypeErrors,
WarningFlag
Opt_WarnTypedHoles,
WarningFlag
Opt_WarnDeferredOutOfScopeVariables,
WarningFlag
Opt_WarnPartialTypeSignatures,
WarningFlag
Opt_WarnUnrecognisedPragmas,
WarningFlag
Opt_WarnMisplacedPragmas,
WarningFlag
Opt_WarnDuplicateExports,
WarningFlag
Opt_WarnDerivingDefaults,
WarningFlag
Opt_WarnOverflowedLiterals,
WarningFlag
Opt_WarnEmptyEnumerations,
WarningFlag
Opt_WarnAmbiguousFields,
WarningFlag
Opt_WarnMissingFields,
WarningFlag
Opt_WarnMissingMethods,
WarningFlag
Opt_WarnWrongDoBind,
WarningFlag
Opt_WarnUnsupportedCallingConventions,
WarningFlag
Opt_WarnDodgyForeignImports,
WarningFlag
Opt_WarnInlineRuleShadowing,
WarningFlag
Opt_WarnAlternativeLayoutRuleTransitional,
WarningFlag
Opt_WarnUnsupportedLlvmVersion,
WarningFlag
Opt_WarnMissedExtraSharedLib,
WarningFlag
Opt_WarnTabs,
WarningFlag
Opt_WarnUnrecognisedWarningFlags,
WarningFlag
Opt_WarnSimplifiableClassConstraints,
WarningFlag
Opt_WarnStarBinder,
WarningFlag
Opt_WarnStarIsType,
WarningFlag
Opt_WarnInaccessibleCode,
WarningFlag
Opt_WarnSpaceAfterBang,
WarningFlag
Opt_WarnNonCanonicalMonadInstances,
WarningFlag
Opt_WarnNonCanonicalMonoidInstances,
WarningFlag
Opt_WarnOperatorWhitespaceExtConflict,
WarningFlag
Opt_WarnForallIdentifier,
WarningFlag
Opt_WarnUnicodeBidirectionalFormatCharacters,
WarningFlag
Opt_WarnGADTMonoLocalBinds,
WarningFlag
Opt_WarnTypeEqualityRequiresOperators
]
minusWOpts :: [WarningFlag]
minusWOpts :: [WarningFlag]
minusWOpts
= [WarningFlag]
standardWarnings [WarningFlag] -> [WarningFlag] -> [WarningFlag]
forall a. [a] -> [a] -> [a]
++
[ WarningFlag
Opt_WarnUnusedTopBinds,
WarningFlag
Opt_WarnUnusedLocalBinds,
WarningFlag
Opt_WarnUnusedPatternBinds,
WarningFlag
Opt_WarnUnusedMatches,
WarningFlag
Opt_WarnUnusedForalls,
WarningFlag
Opt_WarnUnusedImports,
WarningFlag
Opt_WarnIncompletePatterns,
WarningFlag
Opt_WarnDodgyExports,
WarningFlag
Opt_WarnDodgyImports,
WarningFlag
Opt_WarnUnbangedStrictPatterns
]
minusWallOpts :: [WarningFlag]
minusWallOpts :: [WarningFlag]
minusWallOpts
= [WarningFlag]
minusWOpts [WarningFlag] -> [WarningFlag] -> [WarningFlag]
forall a. [a] -> [a] -> [a]
++
[ WarningFlag
Opt_WarnTypeDefaults,
WarningFlag
Opt_WarnNameShadowing,
WarningFlag
Opt_WarnMissingSignatures,
WarningFlag
Opt_WarnHiShadows,
WarningFlag
Opt_WarnOrphans,
WarningFlag
Opt_WarnUnusedDoBind,
WarningFlag
Opt_WarnTrustworthySafe,
WarningFlag
Opt_WarnMissingPatternSynonymSignatures,
WarningFlag
Opt_WarnUnusedRecordWildcards,
WarningFlag
Opt_WarnRedundantRecordWildcards,
WarningFlag
Opt_WarnIncompleteUniPatterns,
WarningFlag
Opt_WarnIncompletePatternsRecUpd
]
minusWeverythingOpts :: [WarningFlag]
minusWeverythingOpts :: [WarningFlag]
minusWeverythingOpts = [ Int -> WarningFlag
forall a. Enum a => Int -> a
toEnum Int
0 .. ]
minusWcompatOpts :: [WarningFlag]
minusWcompatOpts :: [WarningFlag]
minusWcompatOpts
= [ WarningFlag
Opt_WarnSemigroup
, WarningFlag
Opt_WarnNonCanonicalMonoidInstances
, WarningFlag
Opt_WarnCompatUnqualifiedImports
, WarningFlag
Opt_WarnTypeEqualityOutOfScope
]
unusedBindsFlags :: [WarningFlag]
unusedBindsFlags :: [WarningFlag]
unusedBindsFlags = [ WarningFlag
Opt_WarnUnusedTopBinds
, WarningFlag
Opt_WarnUnusedLocalBinds
, WarningFlag
Opt_WarnUnusedPatternBinds
]