Flag referenceThis section is a quick-reference for GHC's command-line
flags. For each flag, we also list its static/dynamic status (see
), and the flag's opposite
(if available).Help and verbosity optionsFlagDescriptionStatic/DynamicReversehelpmode-helpmode-do a dry rundynamic-verbose mode (equivalent to )dynamic-nset verbosity leveldynamic-display GHC versionmode-display the supported language extensionsmode-display information about the compilermode-display GHC versionmode-display GHC version (numeric only)mode-display GHC library directorymode-display GHC documentation directorymode-output full span in error messagesstatic-sizeSet the minimum heap size to sizestatic-Summarise timing stats for GHC (same as +RTS -tstderr)static-Which phases to runFlagDescriptionStatic/DynamicReverseStop after preprocessing (.hspp file)mode-Stop after generating C (.hc file)mode-Stop after generating assembly (.s file)mode-Do not linkdynamic-suffixOverride default behaviour for source filesstatic-Alternative modes of operationFlagDescriptionStatic/DynamicReverseInteractive mode - normally used by just running ghci;
see for details.mode-Build a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than using make;
see for details..mode-Evaluate expr;
see for details.mode-Generate dependency information suitable for use in a Makefile;
see for details.mode-Redirecting outputFlagDescriptionStatic/DynamicReversesuffixset the suffix to use for intermediate C filesdynamic-dirset directory for interface filesdynamic-suffixset the suffix to use for interface filesdynamic-filenameset output filenamedynamic-dirset output directorydynamic-filenameset the filename in which to put the interfacedynamicsuffixset the output file suffixdynamic-dirredirect FFi stub filesdynamic-Keeping intermediate filesFlagDescriptionStatic/DynamicReverse or
retain intermediate .hc filesdynamic- or
retain intermediate .s filesdynamic- or
retain intermediate .raw_s filesdynamic-retain all intermediate temporary filesdynamic-Temporary filesFlagDescriptionStatic/DynamicReverseset the directory for temporary filesdynamic-Finding importsFlagDescriptionStatic/DynamicReversedir1:dir2:...add dir,
dir2, etc. to import pathstatic/:set-Empty the import directory liststatic/:set-Interface file optionsFlagDescriptionStatic/DynamicReverseDump the new interface to stdoutdynamic-Show the differences vs. the old interfacedynamic-Dump a minimal set of importsdynamic-fileRead the interface in
file and dump it as text to
stdout.mode-Recompilation checkingFlagDescriptionStatic/DynamicReverseTurn off recompilation checking; implied by any
optiondynamicInteractive-mode optionsFlagDescriptionStatic/DynamicReverseDisable reading of .ghci filesstatic-Enable reading of .ghci filesstatic-Break on any exception throwndynamicBreak on uncaught exceptions and errorsdynamicEnable usage of Show instances in :printdynamicTurn off printing of binding results in GHCidynamic-PackagesFlagDescriptionStatic/DynamicReversePCompile to be part of package Pdynamic-PExpose package Pstatic/:set-Hide all packages by defaultstatic-nameHide package Pstatic/:set-nameIgnore package Pstatic/:set-fileLoad more packages from filestatic-Don't load the user's package config file.static-Language optionsFlagDescriptionStatic/DynamicReverseEnable most language extensionsdynamicEnable overlapping instancesdynamicEnable incoherent instances.
Implies dynamicEnable undecidable instancesdynamicnset the limit for context reduction. Default is 20.dynamicEnable arrow
notation extensiondynamicEnable record
field disambiguationdynamicEnable foreign function interface (implied by
)dynamicEnable generic classesdynamicEnable Implicit Parameters.
Implied by .dynamicMake tuple pattern matching irrefutabledynamicDon't implicitly import PreludedynamicDisable the monomorphism restrictiondynamicMake pattern bindings polymorphicdynamicRelaxed checking for mutually-recursive polymorphic functionsdynamicUse GHCi's extended default rules in a normal moduledynamicEnable overloaded string literals.
dynamicEnable generalised algebraic data types.
dynamicEnable type families.dynamicEnable lexically-scoped type variables.
Implied by .dynamicEnable Template Haskell.
No longer implied by .dynamicEnable bang patterns.dynamicEnable the C preprocessor.dynamicEnable pattern guards.dynamicEnable view patterns.dynamicEnable unicode syntax.dynamicEnable the “magic hash”.dynamicEnable polymorphic components.dynamicEnable existential quantification.dynamicEnable kind signatures.dynamicEnable pattern type signatures.dynamicEnable empty data declarations.dynamicEnable parallel list comprehensions.dynamicEnable unlifted FFI types.dynamicEnable liberalised type synonyms.dynamicEnable rank-2 types.dynamicEnable rank-N types.dynamicEnable type operators.dynamicEnable recursive do (mdo) notation.dynamicEnable parallel arrays.dynamicEnable record wildcards.dynamicEnable record puns.dynamicEnable the disambiguate fields. exceptiondynamicEnable unboxed tuples.dynamicEnable standalone deriving.dynamicEnable deriving for the Data and Typeable classes.dynamicEnable newtype deriving.dynamicEnable type synonyms.dynamicEnable flexible contexts.dynamicEnable flexible instances.dynamicEnable constrained class methods.dynamicEnable multi parameter type classes.dynamicEnable functional dependencies.dynamicWarningsFlagDescriptionStatic/DynamicReverseenable normal warningsdynamicdisable all warningsdynamic-enable almost all warnings (details in )dynamicmake warnings fataldynamic-Wwarnmake warnings non-fataldynamic-Werrorwarn about uses of functions & types that are deprecateddynamicwarn when an entity is exported multiple timesdynamicwarn when a .hi file in the
current directory shadows a librarydynamicwarn when the Prelude is implicitly importeddynamicwarn when a pattern match could faildynamicwarn when a record update could faildynamicwarn when fields of a record are uninitialiseddynamicwarn when class methods are undefineddynamicwarn about top-level functions without signaturesdynamicwarn when names are shadoweddynamicwarn when the module contains "orphan" instance declarations
or rewrite rulesdynamicwarn about overlapping patternsdynamicwarn about lambda-patterns that can faildynamicwarn if there are tabs in the source filedynamicwarn when defaulting happensdynamicwarn when the Monomorphism Restriction is applieddynamicwarn about bindings that are unuseddynamicwarn about unnecessary importsdynamicwarn about variables in patterns that aren't useddynamicOptimisation levelsFlagDescriptionStatic/DynamicReverseEnable default optimisation (level 1)dynamicnSet optimisation level ndynamicIndividual optimisationsFlagDescriptionStatic/DynamicReverseEnable case-merging. Implied by .dynamicMake dictionaries strictstaticEnable eta-reduction. Implied by .dynamicEnable lambda eta-reductiondynamicEnable excess intermediate precisiondynamicIgnore assertions in the sourcedynamicIgnore pragmas in interface filesdynamicDon't generate interface pragmasdynamicIf a worker has that many arguments, none will be
unpacked anymore (default: 10)static-Set the max iterations for the simplifierdynamic-Turn off the "state hack" whereby any lambda with a real-world state token
as argument is considered to be single-entry. Hence OK to inline things inside it.static-Turn on common sub-expression elimination. Implied by .dynamic-fno-cseTurn on full laziness (floating bindings outwards). Implied by .dynamic-fno-full-lazinessSwitch on all rewrite rules (including rules
generated by automatic specialisation of overloaded functions).
Implied by . dynamicTurn on strictness analysis. Implied by .dynamic-fno-strictnessTurn on the SpecConstr transformation. Implied by .dynamic-fno-spec-constrTurn on the liberate-case transformation. Implied by .dynamic-fno-liberate-case=nSet the size threshold for function specialisation to n, for both
the liberate-case and SpecConstr transformations (default: 200)staticFlatten strict constructor fieldsdynamicTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticTurn off pre-inliningstatic-Profiling optionsFlagDescriptionStatic/DynamicReverseAuto-add _scc_s to all
exported functionsstaticAuto-add _scc_s to all
top-level functionsstaticAuto-add _scc_s to all CAFsstaticTurn on profilingstatic-Turn on ticky-ticky profilingstatic-Program coverage optionsFlagDescriptionStatic/DynamicReverseTurn on Haskell program coverage instrumentationstaticDirectory to deposit .mix files during compilation (default is .hpc)dynamicHaskell pre-processor optionsFlagDescriptionStatic/DynamicReverse
Enable the use of a pre-processor
(set with )
dynamic-C pre-processor optionsFlagDescriptionStatic/DynamicReverseRun the C pre-processor on Haskell source filesdynamic-symbol=valueDefine a symbol in the C pre-processordynamicsymbolsymbolUndefine a symbol in the C pre-processordynamic-dirAdd dir to the
directory search list for #include filesdynamic-C compiler optionsFlagDescriptionStatic/DynamicReversefileInclude file when
compiling the .hc filedynamic-Code generation optionsFlagDescriptionStatic/DynamicReverseUse the native code generatordynamic-fvia-CCompile via Cdynamic-fasmOmit code generationdynamic-Generate byte-codedynamic-Generate object codedynamic-Linking optionsFlagDescriptionStatic/DynamicReverseGenerate position-independent code (where available)static-Use dynamic Haskell libraries (if available)static-nameOn Darwin/MacOS X only, link in the framework name.
This option corresponds to the option for Apple's Linker.dynamic-nameOn Darwin/MacOS X only, add dir to the list of
directories searched for frameworks.
This option corresponds to the option for Apple's Linker.dynamic-libLink in library libdynamic-dirAdd dir to the list of
directories searched for librariesdynamic-Set main module and functiondynamic-DLL-creation mode (Windows only)dynamic-Don't assume this program contains maindynamic-Omit linkingdynamic-Split objects (for libraries)dynamic-Use static Haskell librariesstatic-Use the threaded runtimestatic-Use the debugging runtimestatic-Do not generate a manifest file (Windows only)dynamic-Do not embed the manifest in the executable (Windows only)dynamic-Replacing phasesFlagDescriptionStatic/DynamicReversecmdUse cmd as the literate pre-processordynamic-cmdUse cmd as the C
pre-processor (with only)dynamic-cmdUse cmd as the C compilerdynamic-cmdUse cmd as the manglerdynamic-cmdUse cmd as the splitterdynamic-cmdUse cmd as the assemblerdynamic-cmdUse cmd as the linkerdynamic-cmdUse cmd as the DLL generatordynamic-cmdUse cmd as the pre-processor
(with only)dynamic-cmdUse cmd as the program for
embedding manifests on Windows.dynamic-Forcing options to particular phasesFlagDescriptionStatic/DynamicReverseoptionpass option to the literate pre-processordynamic-optionpass option to cpp (with
only)dynamic-optionpass option to the
custom pre-processordynamic-optionpass option to the C compilerdynamic-optionpass option to the manglerdynamic-optionpass option to the assemblerdynamic-optionpass option to the linkerdynamic-optionpass option to the DLL generatordynamic-optionpass option to the dependency generatordynamic-optionpass option to windres.dynamic-Platform-specific optionsFlagDescriptionStatic/DynamicReverse(x86 only) give some registers back to the C compilerdynamic-External core file optionsFlagDescriptionStatic/DynamicReverseGenerate .hcr external Core filesstatic-Compiler debugging optionsFlagDescriptionStatic/DynamicReverseTurn on internal sanity checkingdynamic-Dump assemblydynamic-Dump interpreter byte codedynamic-Dump C-- outputdynamic-Dump output from CPR analysisdynamic-Dump CSE outputdynamic-Dump deriving outputdynamic-Dump desugarer outputdynamic-Dump “flat” Cdynamic-Dump foreign export stubsdynamic-Dump after intrumentation for program coveragedynamic-Dump inlining infodynamic-Dump occurrence analysis outputdynamic-Dump the results of C-- to C-- optimising passesdynamic-Dump parse treedynamic-Dump prepared coredynamic-Dump renamer outputdynamic-Dump rulesdynamic-Dump final simplifier outputdynamic-Dump output from each simplifier iterationdynamic-Dump specialiser outputdynamic-Dump TH splided expressions, and what they evaluate todynamic-Dump final STGdynamic-Dump strictness analyser outputdynamic-Dump typechecker outputdynamic-Dump type signaturesdynamic-Dump worker-wrapper outputdynamic-Trace interface filesdynamic-Trace typecheckerdynamic-Trace renamerdynamic-Renamer statsdynamic-Dump simplifier statsdynamic-Turn on debug printing (more verbose)static-Don't output pragma info in dumpsstatic-Set the depth for printing expressions in error msgsstatic-Dump haskell source statsdynamic-C-- pass sanity checkingdynamic-STG pass sanity checkingdynamic-Dump STG statsdynamic-Show output from each core-to-core passdynamic-Show output from each STG-to-STG passdynamic-Print out each pass name as it happensdynamic-Show statistics for fast string usage when finisheddynamic-Misc compiler optionsFlagDescriptionStatic/DynamicReverseDon't complain about .hi file mismatchesstatic-Turn off black holing (probably doesn't work)static-Don't share specialisations of overloaded functionsstatic-Set simplification history sizestatic-Unregisterised compilation (use instead)static-Turn off assembly mangling (use instead)dynamic-