HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

  • Packageghc-9.10.3
  • Exports108
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceFlags.hs

Dynamic flags and associated configuration types

69 declarations
datadata DumpFlag
#

Debugging flags

Constructors

Instances3Enum, Eq, Show
datadata GeneralFlag
#

Enumerates the simple on-or-off dynamic flags

Constructors

Instances3Enum, Eq, Show
datadata WarningFlag
#
Opt_WarnDuplicateExportsOpt_WarnDuplicateConstraintsOpt_WarnRedundantConstraintsOpt_WarnHiShadowsOpt_WarnImplicitPreludeOpt_WarnIncompletePatternsOpt_WarnIncompleteUniPatternsOpt_WarnIncompletePatternsRecUpdOpt_WarnOverflowedLiteralsOpt_WarnEmptyEnumerationsOpt_WarnMissingFieldsOpt_WarnMissingImportListOpt_WarnMissingMethodsOpt_WarnMissingSignaturesOpt_WarnMissingLocalSignaturesOpt_WarnNameShadowingOpt_WarnOverlappingPatternsOpt_WarnTypeDefaultsOpt_WarnMonomorphismOpt_WarnUnusedTopBindsOpt_WarnUnusedLocalBindsOpt_WarnUnusedPatternBindsOpt_WarnUnusedImportsOpt_WarnUnusedMatchesOpt_WarnUnusedTypePatternsOpt_WarnUnusedForallsOpt_WarnUnusedRecordWildcardsOpt_WarnRedundantBangPatternsOpt_WarnRedundantRecordWildcardsOpt_WarnDeprecatedFlagsOpt_WarnMissingMonadFailInstancesOpt_WarnSemigroupOpt_WarnDodgyExportsOpt_WarnDodgyImportsOpt_WarnOrphansOpt_WarnAutoOrphansOpt_WarnIdentitiesOpt_WarnTabsOpt_WarnUnrecognisedPragmasOpt_WarnMisplacedPragmasOpt_WarnDodgyForeignImportsOpt_WarnUnusedDoBindOpt_WarnWrongDoBindOpt_WarnAlternativeLayoutRuleTransitionalOpt_WarnUnsafeOpt_WarnSafeOpt_WarnTrustworthySafeOpt_WarnMissedSpecsOpt_WarnAllMissedSpecsOpt_WarnUnsupportedCallingConventionsOpt_WarnUnsupportedLlvmVersionOpt_WarnMissedExtraSharedLibOpt_WarnInlineRuleShadowingOpt_WarnTypedHolesOpt_WarnPartialTypeSignaturesOpt_WarnMissingExportedSignaturesOpt_WarnUntickedPromotedConstructorsOpt_WarnDerivingTypeableOpt_WarnDeferredTypeErrorsOpt_WarnDeferredOutOfScopeVariablesOpt_WarnNonCanonicalMonadInstancesOpt_WarnNonCanonicalMonadFailInstancesOpt_WarnNonCanonicalMonoidInstancesOpt_WarnMissingPatternSynonymSignaturesOpt_WarnUnrecognisedWarningFlagsOpt_WarnSimplifiableClassConstraintsOpt_WarnCPPUndefOpt_WarnUnbangedStrictPatternsOpt_WarnMissingHomeModulesOpt_WarnPartialFieldsOpt_WarnMissingExportListOpt_WarnInaccessibleCodeOpt_WarnStarIsTypeOpt_WarnStarBinderOpt_WarnImplicitKindVarsOpt_WarnSpaceAfterBangOpt_WarnMissingDerivingStrategiesOpt_WarnPrepositiveQualifiedModuleOpt_WarnUnusedPackagesOpt_WarnInferredSafeImportsOpt_WarnMissingSafeHaskellModeOpt_WarnCompatUnqualifiedImportsOpt_WarnDerivingDefaultsOpt_WarnInvalidHaddockOpt_WarnOperatorWhitespaceExtConflictOpt_WarnOperatorWhitespaceOpt_WarnAmbiguousFieldsOpt_WarnImplicitLiftOpt_WarnMissingKindSignaturesOpt_WarnMissingPolyKindSignaturesOpt_WarnMissingExportedPatternSynonymSignaturesOpt_WarnRedundantStrictnessFlagsOpt_WarnForallIdentifierOpt_WarnUnicodeBidirectionalFormatCharactersOpt_WarnGADTMonoLocalBindsOpt_WarnTypeEqualityOutOfScopeOpt_WarnTypeEqualityRequiresOperatorsOpt_WarnLoopySuperclassSolveOpt_WarnTermVariableCaptureOpt_WarnMissingRoleAnnotationsOpt_WarnImplicitRhsQuantificationOpt_WarnIncompleteExportWarningsOpt_WarnIncompleteRecordSelectorsOpt_WarnBadlyStagedTypesOpt_WarnInconsistentFlagsOpt_WarnDataKindsTCOpt_WarnDeprecatedTypeAbstractionsOpt_WarnDefaultedExceptionContext
Instances5Bounded, Enum, Eq, Ord, Show
datadata DiagnosticReason
#

The reason why a Diagnostic was emitted in the first place. Diagnostic messages are born within GHC with a very precise reason, which can be completely statically-computed (i.e. this is an error or a warning no matter what), or influenced by the specific state of the DynFlags at the moment of the creation of a new Diagnostic. For example, a parsing error is always going to be an error, whereas a 'WarningWithoutFlag Opt_WarnUnusedImports' might turn into an error due to '-Werror' or '-Werror=warn-unused-imports'. Interpreting a DiagnosticReason together with its associated Severity gives us the full picture.

Constructors

Instances3Eq, Show, Outputable
datadata Language
#
Instances7Bounded, Enum, Eq, Show, NFData, Outputable, …
valuegopt :: GeneralFlag -> DynFlags -> Bool
#

Test whether a GeneralFlag is set

Note that dynamicNow (i.e., dynamic objects built with `-dynamic-too`) always implicitly enables Opt_PIC, Opt_ExternalDynamicRefs, and disables Opt_SplitSections.

datadata DynFlags
#

Contains not only a collection of GeneralFlags but also a plethora of information relating to the compilation of a single file or GHC session

Constructors

classclass HasDynFlags (m :: Type -> Type) where
#

Methods

Instances13HasDynFlags, …
datadata GhcMode
#

The GhcMode tells us whether we're doing multi-module compilation (controlled via the GHC API) or one-shot (single-module) compilation. This makes a difference primarily to the GHC.Unit.Finder: in one-shot mode we look for interface files for imported modules, but in multi-module mode we look for source files in order to check whether they need to be recompiled.

Constructors

Instances2Eq, Outputable
datadata PackageArg
#

We accept flags which make packages visible, but how they select the package varies; this data type reflects what selection criterion is used.

Constructors

Instances3Eq, Show, Outputable
datadata ModRenaming
#

Represents the renaming that may be associated with an exposed package, e.g. the rns part of -package "foo (rns)".

Here are some example parsings of the package flags (where a string literal is punned to be a ModuleName:

  • -package foo is ModRenaming True []

  • -package foo () is ModRenaming False []

  • -package foo (A) is ModRenaming False [(A, A)]

  • -package foo (A as B) is ModRenaming False [(A, B)]

  • -package foo with (A as B) is ModRenaming True [(A, B)]

Constructors

Instances2Eq, Outputable
datadata Option
#

When invoking external tools as part of the compilation pipeline, we pass these a sequence of options on the command-line. Rather than just using a list of Strings, we use a type that allows us to distinguish between filepaths and 'other stuff'. The reason for this is that this type gives us a handle on transforming filenames, and filenames only, to whatever format they're expected to be on a particular platform.

Instances1Eq
  • Eq OptionDefined in ghc-9.10.3 · GHC.Utils.CliOption

The set of flags which affect optimisation for the purposes of recompilation avoidance. Specifically, these include flags which affect code generation but not the semantics of the program.

See Note [Ignoring some flag changes] in GHC.Iface.Recomp.Flags)

Manipulating DynFlags

The language extensions implied by the various language variants. When updating this be sure to update the flag documentation in docsusers_guideexts.

System tool settings and locations

The directory for this version of ghc in the user's app directory The appdir used to be in ~/.ghc but to respect the XDG specification we want to move it under $XDG_DATA_HOME/ However, old tooling (like cabal) might still write package environments to the old directory, so we prefer that if a subdirectory of ~/.ghc with the correct target and GHC version suffix exists.

i.e. if ~.ghc$UNIQUE_SUBDIR exists we use that otherwise we use $XDG_DATA_HOME/$UNIQUE_SUBDIR

UNIQUE_SUBDIR is typically a combination of the target platform and GHC version

Linker/compiler information

2 declarations

Include specifications

5 declarations

Append to the list of includes a path that shall be included using `-iquote` when the C compiler is called. These paths only apply when quoted includes are used. e.g. #include "foo.h"

SDoc

3 declarations

Platform features

10 declarations