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-verbose mode (equivalent to )dynamic-nset verbosity leveldynamic-display GHC versionmode- or display the supported languages and 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 messagesdynamic-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-dirredirect dump filesdynamic-dirset output directorydynamic-Keeping intermediate filesFlagDescriptionStatic/DynamicReverse or
retain intermediate .hc filesdynamic- or
retain intermediate LLVM .ll filesdynamic- or
retain intermediate .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 filesdynamic-Read additional .ghci filesdynamic-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-Select the function
to use for printing evaluated expressions in GHCidynamic-PackagesFlagDescriptionStatic/DynamicReversePCompile to be part of package Pstatic-PExpose package Pstatic/:set-Hide all packages by defaultstatic-nameHide package Pstatic/:set-nameIgnore package Pstatic/:set-fileAdd file to the package db stack.static-Clear the package db stack.static-Remove the global package db from the stack.static-Add the global package db to the stack.static-Remove the user's package db from the stack.static-Add the user's package db to the stack.static-Don't automatically link in the haskell98 package.dynamic-PExpose package P and set it to be
trustedstatic/:set-PExpose package P and set it to be
distrustedstatic/:set-Distrust all packages by defaultstatic/:set-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 extensions; see for exactly which ones.dynamicEnable 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
)dynamicDeprecated, does nothing. No longer enables generic classes.
See also GHC's support for
generic programming.dynamicEnable Implicit Parameters.
Implied by .dynamicMake tuple pattern matching irrefutabledynamicDon't implicitly import PreludedynamicEmploy rebindable syntaxdynamicDisable the monomorphism restrictiondynamicDisable support for n+k patternsdynamicDisable support for traditional record syntax (as supported by Haskell 98) C {f = x}dynamicMake 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 generalised algebraic data type syntax.
dynamicEnable type families.dynamicEnable a kind of constraints.dynamicEnable datatype promotion.dynamicEnable kind polymorphism.
Implies .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 explicit universal quantification.
Implied by ,
,
,
dynamicEnable polymorphic components for data constructors.dynamic, synonym for Enable rank-2 types.dynamic, synonym for Enable 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 monad comprehensions.dynamicEnable unlifted FFI types.dynamicEnable interruptible FFI.dynamicEnable liberalised type synonyms.dynamicEnable type operators.dynamicEnable using the keyword type to specify the namespace of entries in imports and exports.dynamicEnable recursive do (mdo) notation.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 deriving for the Generic class.dynamicEnable newtype deriving.dynamicEnable type synonyms in instance heads.dynamicEnable flexible contexts.dynamicEnable flexible instances.
Implies dynamicEnable constrained class methods.dynamicEnable default signatures.dynamicEnable multi parameter type classes.dynamicEnable functional dependencies.dynamicEnable package-qualified imports.dynamicEnable lambda-case expressions.dynamicEnable multi-way if-expressions.dynamicEnable the Safe Haskell Safe mode.dynamicEnable the Safe Haskell Trustworthy mode.dynamicEnable Safe Haskell Unsafe mode.dynamicEnable Safe Haskell trusted package requirement for trustworty modules.dynamicWarningsFlagDescriptionStatic/DynamicReverseenable normal warningsdynamicdisable all warningsdynamic-enable almost all warnings (details in )dynamicmake warnings fataldynamic-Wwarnmake warnings non-fataldynamic-WerrorDefer as many type errors as possible until runtime.dynamicMake suggestions for mis-spelled names.dynamicwarn 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 about uses of Prelude numeric conversions that are probably
the identity (and hence could be omitted)dynamicwarn when the Prelude is implicitly importeddynamicwarn when a pattern match could faildynamicwarn when a pattern match in a lambda expression or pattern binding could faildynamicwarn when a record update could faildynamicwarn when a pattern binding looks lazy but must be strictdynamicwarn when fields of a record are uninitialiseddynamicwarn when an import declaration does not explicitly
list all the names brought into scopedynamicwarn when class methods are undefineddynamicwarn about top-level functions without signaturesdynamicwarn about polymorphic local bindings without signaturesdynamicwarn when the Monomorphism Restriction is applieddynamicwarn when names are shadoweddynamicwarn when the module contains orphan instance declarations
or rewrite rulesdynamicwarn about overlapping patternsdynamicwarn if there are tabs in the source filedynamicwarn when defaulting happensdynamicwarn about uses of pragmas that GHC doesn't recognisedynamicwarn 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 insteaddynamicwarn if the module being compiled is regarded to be unsafe.
Should be used to check the safety status of modules when using safe
inference.dynamicwarn if the module being compiled is regarded to be safe.
Should be used to check the safety status of modules when using safe
inference.dynamicwarn about uses of functions & types that have warnings or deprecated pragmasdynamicOptimisation levelsFlagDescriptionStatic/DynamicReverseEnable default optimisation (level 1)dynamicnSet optimisation level ndynamicIndividual optimisationsFlagDescriptionStatic/DynamicReverseEnable case-merging. Implied by .dynamicTurn on common sub-expression elimination. Implied by .dynamic-fno-cseMake dictionaries strictstaticEnable eta-reduction. Implied by .dynamicEnable lambda eta-reductiondynamicTurn on eager blackholingdynamic-Switch on all rewrite rules (including rules
generated by automatic specialisation of overloaded functions).
Implied by . dynamicEnable vectorisation of nested data parallelismdynamicEnable vectorisation avoidance (EXPERIMENTAL)dynamicEnable excess intermediate precisiondynamicTurn on the float-in transformation. Implied by .dynamic-fno-float-inTurn on full laziness (floating bindings outwards). Implied by .dynamic-fno-full-lazinessIgnore assertions in the sourcedynamicIgnore pragmas in interface filesdynamicTurn on the liberate-case transformation. Implied by .dynamic-fno-liberate-case=nSet the size threshold for the liberate-case transformation to n (default: 200)staticSet the max iterations for the simplifierdynamic-If a worker has that many arguments, none will be
unpacked anymore (default: 10)dynamic-Turn off the coercion optimiserstatic-Turn off pre-inliningdynamic-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-Make GHC be more precise about its treatment of bottom (but see also
). In particular, GHC will not
eta-expand through a case expression.dynamicDon't generate interface pragmasdynamicSet the number of phases for the simplifier (default 2).
Ignored with .dynamic-Set the percentage factor for simplifier ticks (default 100)dynamic-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 specialisation of overloaded functions. Implied by .dynamic-fno-specialiseTurn on strictness analysis. Implied by .dynamic-fno-strictness=nRun an additional strictness analysis before simplifier
phase ndynamic-Turn on the static argument transformation. Implied by .dynamic-fno-static-argument-transformationFlatten strict constructor fieldsdynamicTweak unfolding settingsdynamicTweak unfolding settingsdynamicTweak unfolding settingsdynamicTweak unfolding settingsdynamicProfiling optionsFlagDescriptionStatic/DynamicReverseTurn on profilingstatic-Auto-add SCCs to all bindings
not marked INLINEdynamicAuto-add SCCs to all top-level
bindings not marked INLINEdynamicAuto-add SCCs to all exported
bindings not marked INLINEdynamicAuto-add SCCs to all CAFsdynamicDo not collect entry countsdynamicTurn on ticky-ticky profilingstatic-Program coverage optionsFlagDescriptionStatic/DynamicReverseTurn on Haskell program coverage instrumentationdynamicDirectory 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-fllvmCompile using the LLVM code
generatordynamic-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)dynamic-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-, Control whether the RTS behaviour can be tweaked via command-line
flags and the GHCRTS environment
variable. Using none means no RTS flags can be given; some means only a minimum of safe options can be given (the default), and all (or no argument at all) means that all RTS flags are permitted.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-Plugin optionsFlagDescriptionStatic/DynamicReverse=moduleLoad a plugin exported by a given modulestatic-=module:argsGive arguments to a plugin module; module must be specified with static-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 LLVM optimiserdynamic-cmdUse cmd as the LLVM compilerdynamic-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 LLVM optimiserdynamic-optionpass option to the LLVM 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 to files instead of stdoutdynamic-Dump assemblydynamic-Dump interpreter byte codedynamic-Dump C-- outputdynamic-Print a one-line summary of the size of the Core program
at the end of the optimisation pipeline dynamic-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 LLVM intermediate codedynamic-Dump occurrence analysis outputdynamic-Dump the results of C-- to C-- optimising passesdynamic-Dump parse treedynamic-Dump prepared coredynamic-Dump renamer outputdynamic-Dump rule firing infodynamic-Dump detailed rule firing infodynamic-Dump rulesdynamic-Dump vectoriser input and outputdynamic-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 vectoriserdynamic-Trace renamerdynamic-Renamer statsdynamic-Dump simplifier statsdynamic-Suppress unsolicited debugging outputstatic-Turn on debug printing (more verbose)static-Don't output pragma info in dumpsstatic-Set the depth for printing expressions in error msgsdynamic-Set the width of debugging output. For example dynamic-Print single alternative case expressions as strict lets.dynamic-In core dumps, suppress everything (except for uniques) that is suppressable.dynamic-Suppress the printing of uniques in debug output (easier to use diff)dynamic-Suppress extended information about identifiers where they are bounddynamic-Suppress the printing of module qualification prefixesdynamic-Suppress type signaturesdynamic-Suppress type applicationsdynamic-Suppress the printing of coercions in Core dumps to make them shorterdynamic-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 sizedynamic-Unregisterised compilation (use instead)static-Do not use the load/store the GHCi command history from/to ghci_history.dynamic-Turn off the GHCi sandbox. Means computations are run in the main thread, rather than a forked thread.dynamic-