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-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 directory for object filesdynamic-filenameset the filename in which to put the interfacedynamicsuffixset the output file suffixdynamic-dirredirect FFi stub filesdynamic-dirset output directorydynamic-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-fileSee .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 on printing of binding results in GHCidynamicTurn off printing of binding contents in GHCidynamic-Turn off
implicit qualified import of everything 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-Don't automatically link in the haskell98 package.dynamic-Language optionsLanguage options can be enabled either by a command-line option
, or by a {-# LANGUAGE blah #-}
pragma in the file itself. See FlagDescriptionStatic/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 restrictiondynamicDisable support for n+k patternsdynamicMake 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 do not generalise local bindings.
dynamicEnable Template Haskell.
No longer implied by .dynamicEnable quasiquotation.dynamicEnable bang patterns.dynamicEnable the C preprocessor.dynamicEnable pattern guards.dynamicEnable view patterns.dynamicEnable unicode syntax.dynamicAllow "#" as a postfix modifier on identifiers.dynamicEnable new
qualified operator syntaxdynamicEnable explicit universal quantification.
Implied by ,
,
,
,
,
dynamicEnable polymorphic components for data constructors.dynamicEnable rank-2 types.dynamicEnable rank-N types.dynamicEnable impredicative types.dynamicEnable existential quantification.dynamicEnable kind signatures.dynamicEnable empty data declarations.dynamicEnable parallel list comprehensions.dynamicEnable generalised list comprehensions.dynamicEnable unlifted FFI types.dynamicEnable liberalised type synonyms.dynamicEnable type operators.dynamicEnable recursive do notation.dynamicEnable recursive do (mdo) notation. This is deprecated; please use recursive do notation instead.dynamicEnable parallel arrays.dynamicEnable record wildcards.dynamicEnable record puns.dynamicEnable record field disambiguation. dynamicEnable unboxed tuples.dynamicEnable standalone deriving.dynamicEnable deriving for the Data and Typeable classes.dynamicEnable newtype deriving.dynamicEnable type synonyms in instance heads.dynamicEnable flexible contexts.dynamicEnable flexible instances.dynamicEnable constrained class methods.dynamicEnable multi parameter type classes.dynamicEnable functional dependencies.dynamicEnable package-qualified imports.dynamicWarningsFlagDescriptionStatic/DynamicReverseenable normal warningsdynamicdisable all warningsdynamic-enable almost all warnings (details in )dynamicmake warnings fataldynamic-Wwarnmake warnings non-fataldynamic-Werrorwarn about uses of pragmas that GHC doesn't recognisedynamicwarn about uses of functions & types that have warnings or deprecated pragmasdynamicwarn about uses of commandline flags 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 explicit imports lack an import listdynamicwarn 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 useddynamicwarn about do bindings that appear to throw away values of types other than ()dynamicwarn about do bindings that appear to throw away monadic values that you should have bound insteaddynamicOptimisation levelsFlagDescriptionStatic/DynamicReverseEnable default optimisation (level 1)dynamicnSet optimisation level ndynamicIndividual optimisationsFlagDescriptionStatic/DynamicReverseEnable case-merging. Implied by .dynamicMake dictionaries strictstaticShare specialisations of overloaded functions (default)dynamicEnable 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 number of phases for the simplifier (default 2).
Ignored with .dynamic-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 specialisation of overloaded functions. Implied by .dynamic-fno-specialiseTurn on full laziness (floating bindings outwards). Implied by .dynamic-fno-full-lazinessTurn on the float-in transformation. Implied by .dynamic-fno-float-inSwitch on all rewrite rules (including rules
generated by automatic specialisation of overloaded functions).
Implied by . dynamicTurn on strictness analysis. Implied by .dynamic-fno-strictness=nRun an additional strictness analysis before simplifier
phase ndynamic-Turn on the SpecConstr transformation. Implied by .dynamic-fno-spec-constr=nSet the size threshold for the SpecConstr transformation to n (default: 200)static=nSet to n (default: 3) the maximum number of
specialisations that will be created for any one function
by the SpecConstr transformationstaticTurn on the liberate-case transformation. Implied by .dynamic-fno-liberate-caseTurn on the static argument transformation. Implied by .dynamic-fno-static-argument-transformation=nSet the size threshold for the liberate-case transformation to n (default: 200)staticFlatten strict constructor fieldsdynamicTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticTurn off pre-inliningstatic-Turn on eager blackholingdynamic-Profiling optionsFlagDescriptionStatic/DynamicReverseAuto-add _scc_s to all
exported functions not marked INLINEdynamicAuto-add _scc_s to all
top-level functions not marked INLINEdynamicAuto-add _scc_s to all CAFsdynamicTurn 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-Code generation optionsFlagDescriptionStatic/DynamicReverseUse the native code generatordynamic-fvia-CCompile via Cdynamic-fasmOmit code generationdynamic-Generate byte-codedynamic-Generate object codedynamic-Linking optionsFlagDescriptionStatic/DynamicReverseGenerate a shared library (as opposed to an executable)dynamic-Generate position-independent code (where available)static-Use dynamic Haskell libraries (if available)static-Selects one of a number of modes for finding shared
libraries at runtime.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-Allow the RTS behaviour to be tweaked via command-line
flags and the GHCRTS environment
variable.dynamic-Set the default RTS options to
opts.dynamic-Omit linkingdynamic-Split objects (for libraries)dynamic-Use static Haskell librariesstatic-Use the threaded runtimestatic-Use the debugging runtimestatic-Enable runtime event tracingstatic-Do not generate a manifest file (Windows only)dynamic-Do not embed the manifest in the executable (Windows only)dynamic-Don't generate an import library for a DLL (Windows only)dynamic-pathSet the install name (via -install_name passed to Apple's
linker), specifying the full install path of the library file. Any libraries
or executables that link with it later will pick up that path as their
runtime search location for it. (Darwin/MacOS X 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 windres.dynamic-Platform-specific optionsFlagDescriptionStatic/DynamicReverse(x86 only) Use SSE2 for floating pointdynamic-(x86 only) give some registers back to the C compilerdynamic-External core file optionsFlagDescriptionStatic/DynamicReverseGenerate .hcr external Core filesdynamic-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 instrumentation 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 phasedynamic-Dump output from each simplifier iterationdynamic-Dump specialiser outputdynamic-Dump TH spliced 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-Suppress unsolicited debugging outputstatic-Turn on debug printing (more verbose)static-Suppress the printing of uniques in debug output (easier to use diff.static-Suppress the printing of coercions in Core dumps to make them shorter.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-Set simplification history sizestatic-Unregisterised compilation (use instead)static-Turn off assembly mangling (use instead)dynamic-