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 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 ghcimode-Build a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than using make.mode-Evaluate exprmode-Generate dependency information suitable for use in a Makefile.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/DynamicReverseretain intermediate .hc filesdynamic-retain intermediate .s filesdynamic-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 pathdynamic-Empty the import directory listdynamic-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-Generate bytecode enabled for debuggingdynamic-Do not include debugging information in bytecodesdynamic-PackagesFlagDescriptionStatic/DynamicReversePCompile to be part of package Pdynamic-PExpose package Pdynamic-Hide all packages by defaultstatic-nameHide package Pdynamic-nameIgnore package Pdynamic-fileLoad more packages from filedynamic-Don't load the user's package config file.dynamic-Language optionsFlagDescriptionStatic/DynamicReverseEnable overlapping instancesdynamicEnable incoherent instances.
Implies dynamicEnable undecidable instancesdynamicnset the limit for context reductiondynamicEnable arrow
notation extensiondynamic or Enable foreign function interface (implied by
)dynamicEnable generic classesdynamicEnable most language extensionsdynamicEnable Implicit Parameters.
Implied by .dynamicMake tuple pattern matching irrefutabledynamicDon't implicitly import PreludedynamicDisable the monomorphism restrictiondynamicMake pattern bindings polymorphicdynamicUse GHCi's extended default rules in a normal moduledynamicEnable lexically-scoped type variables.
Implied by .dynamicEnable Template Haskell.
No longer implied by .dynamicEnable bang patterns.dynamicWarningsFlagDescriptionStatic/DynamicReverseenable normal warningsdynamicdisable all warningsdynamic-enable all warningsdynamicmake warnings fataldynamicwarn 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 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 when defaulting happensdynamicwarn 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-mergingdynamicMake dictionaries strictstaticEnable eta-reductiondynamicEnable lambda eta-reductiondynamicEnable excess intermediate precisiondynamicSwitch off all rewrite rules (including rules
generated by automatic specialisation of overloaded functions)staticIgnore assertions in the sourcedynamicIgnore pragmas in interface filesdynamicTweak the liberate-case optimisation (default: 10)staticDon'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 off common sub-expressiondynamic-Turn off full laziness (floating bindings outwards).dynamic-ffull-lazinessTurn off pre-inliningstatic-Turn off strictness analysisdynamic-Flatten strict constructor fieldsdynamicTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticProfiling 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-Haskell 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 generationmode-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 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-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-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-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 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-Enable unregisterised compilationstatic-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-Turn off printing of binding results in GHCidynamic-