Flag reference This 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 options Flag Description Static/Dynamic Reverse help mode - help mode - do a dry run dynamic - verbose mode (equivalent to ) dynamic - n set verbosity level dynamic - display GHC version mode - display the supported language extensions mode - display information about the compiler mode - display GHC version mode - display GHC version (numeric only) mode - display GHC library directory mode - output full span in error messages static - size Set the minimum heap size to size static - Summarise timing stats for GHC (same as +RTS -tstderr) static - Which phases to run Flag Description Static/Dynamic Reverse Stop after preprocessing (.hspp file) mode - Stop after generating C (.hc file) mode - Stop after generating assembly (.s file) mode - Do not link dynamic - suffix Override default behaviour for source files static - Alternative modes of operation Flag Description Static/Dynamic Reverse Interactive 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 output Flag Description Static/Dynamic Reverse suffix set the suffix to use for intermediate C files dynamic - dir set directory for interface files dynamic - suffix set the suffix to use for interface files dynamic - filename set output filename dynamic - dir set directory for object files dynamic - filename set the filename in which to put the interface dynamic suffix set the output file suffix dynamic - dir redirect FFi stub files dynamic - dir set output directory dynamic - Keeping intermediate files Flag Description Static/Dynamic Reverse or retain intermediate .hc files dynamic - or retain intermediate .s files dynamic - or retain intermediate .raw_s files dynamic - retain all intermediate temporary files dynamic - Temporary files Flag Description Static/Dynamic Reverse set the directory for temporary files dynamic - Finding imports Flag Description Static/Dynamic Reverse dir1:dir2:... add dir, dir2, etc. to import path static/:set - Empty the import directory list static/:set - Interface file options Flag Description Static/Dynamic Reverse Dump the new interface to stdout dynamic - Show the differences vs. the old interface dynamic - Dump a minimal set of imports dynamic - file See . Recompilation checking Flag Description Static/Dynamic Reverse Turn off recompilation checking; implied by any option dynamic Interactive-mode options Flag Description Static/Dynamic Reverse Disable reading of .ghci files static - Enable reading of .ghci files static - Break on any exception thrown dynamic Break on uncaught exceptions and errors dynamic Enable usage of Show instances in :print dynamic Turn on printing of binding results in GHCi dynamic Turn off printing of binding contents in GHCi dynamic - Turn off implicit qualified import of everything in GHCi dynamic - Packages Flag Description Static/Dynamic Reverse P Compile to be part of package P dynamic - P Expose package P static/:set - Hide all packages by default static - name Hide package P static/:set - name Ignore package P static/:set - file Load more packages from file static - Don't load the user's package config file. static - Don't automatically link in the haskell98 package. dynamic - Language options Language options can be enabled either by a command-line option , or by a {-# LANGUAGE blah #-} pragma in the file itself. See Flag Description Static/Dynamic Reverse Enable most language extensions dynamic Enable overlapping instances dynamic Enable incoherent instances. Implies dynamic Enable undecidable instances dynamic n set the limit for context reduction. Default is 20. dynamic Enable arrow notation extension dynamic Enable record field disambiguation dynamic Enable foreign function interface (implied by ) dynamic Enable generic classes dynamic Enable Implicit Parameters. Implied by . dynamic Make tuple pattern matching irrefutable dynamic Don't implicitly import Prelude dynamic Disable the monomorphism restriction dynamic Disable support for n+k patterns dynamic Make pattern bindings polymorphic dynamic Relaxed checking for mutually-recursive polymorphic functions dynamic Use GHCi's extended default rules in a normal module dynamic Enable overloaded string literals. dynamic Enable generalised algebraic data types. dynamic Enable type families. dynamic Enable lexically-scoped type variables. Implied by . dynamic Enable do not generalise local bindings. dynamic Enable Template Haskell. No longer implied by . dynamic Enable quasiquotation. dynamic Enable bang patterns. dynamic Enable the C preprocessor. dynamic Enable pattern guards. dynamic Enable view patterns. dynamic Enable unicode syntax. dynamic Allow "#" as a postfix modifier on identifiers. dynamic Enable new qualified operator syntax dynamic Enable explicit universal quantification. Implied by , , , , , dynamic Enable polymorphic components for data constructors. dynamic Enable rank-2 types. dynamic Enable rank-N types. dynamic Enable impredicative types. dynamic Enable existential quantification. dynamic Enable kind signatures. dynamic Enable empty data declarations. dynamic Enable parallel list comprehensions. dynamic Enable generalised list comprehensions. dynamic Enable unlifted FFI types. dynamic Enable liberalised type synonyms. dynamic Enable type operators. dynamic Enable recursive do notation. dynamic Enable recursive do (mdo) notation. This is deprecated; please use recursive do notation instead. dynamic Enable parallel arrays. dynamic Enable record wildcards. dynamic Enable record puns. dynamic Enable record field disambiguation. dynamic Enable unboxed tuples. dynamic Enable standalone deriving. dynamic Enable deriving for the Data and Typeable classes. dynamic Enable newtype deriving. dynamic Enable type synonyms in instance heads. dynamic Enable flexible contexts. dynamic Enable flexible instances. dynamic Enable constrained class methods. dynamic Enable multi parameter type classes. dynamic Enable functional dependencies. dynamic Enable package-qualified imports. dynamic Warnings Flag Description Static/Dynamic Reverse enable normal warnings dynamic disable all warnings dynamic - enable almost all warnings (details in ) dynamic make warnings fatal dynamic -Wwarn make warnings non-fatal dynamic -Werror warn about uses of pragmas that GHC doesn't recognise dynamic warn about uses of functions & types that have warnings or deprecated pragmas dynamic warn about uses of commandline flags that are deprecated dynamic warn when an entity is exported multiple times dynamic warn when a .hi file in the current directory shadows a library dynamic warn when the Prelude is implicitly imported dynamic warn when a pattern match could fail dynamic warn when a record update could fail dynamic warn when fields of a record are uninitialised dynamic warn when explicit imports lack an import list dynamic warn when class methods are undefined dynamic warn about top-level functions without signatures dynamic warn when names are shadowed dynamic warn when the module contains orphan instance declarations or rewrite rules dynamic warn about overlapping patterns dynamic warn about lambda-patterns that can fail dynamic warn if there are tabs in the source file dynamic warn when defaulting happens dynamic warn when the Monomorphism Restriction is applied dynamic warn about bindings that are unused dynamic warn about unnecessary imports dynamic warn about variables in patterns that aren't used dynamic warn about do bindings that appear to throw away values of types other than () dynamic warn about do bindings that appear to throw away monadic values that you should have bound instead dynamic Optimisation levels Flag Description Static/Dynamic Reverse Enable default optimisation (level 1) dynamic n Set optimisation level n dynamic Individual optimisations Flag Description Static/Dynamic Reverse Enable case-merging. Implied by . dynamic Make dictionaries strict static Share specialisations of overloaded functions (default) dynamic Enable eta-reduction. Implied by . dynamic Enable lambda eta-reduction dynamic Enable excess intermediate precision dynamic Ignore assertions in the source dynamic Ignore pragmas in interface files dynamic Don't generate interface pragmas dynamic If 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 simplifier dynamic - 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-cse Turn on specialisation of overloaded functions. Implied by . dynamic -fno-specialise Turn on full laziness (floating bindings outwards). Implied by . dynamic -fno-full-laziness Turn on the float-in transformation. Implied by . dynamic -fno-float-in Switch on all rewrite rules (including rules generated by automatic specialisation of overloaded functions). Implied by . dynamic Turn on strictness analysis. Implied by . dynamic -fno-strictness =n Run an additional strictness analysis before simplifier phase n dynamic - Turn on the SpecConstr transformation. Implied by . dynamic -fno-spec-constr =n Set the size threshold for the SpecConstr transformation to n (default: 200) static =n Set to n (default: 3) the maximum number of specialisations that will be created for any one function by the SpecConstr transformation static Turn on the liberate-case transformation. Implied by . dynamic -fno-liberate-case Turn on the static argument transformation. Implied by . dynamic -fno-static-argument-transformation =n Set the size threshold for the liberate-case transformation to n (default: 200) static Flatten strict constructor fields dynamic Tweak unfolding settings static Tweak unfolding settings static Tweak unfolding settings static Tweak unfolding settings static Turn off pre-inlining static - Turn on eager blackholing dynamic - Profiling options Flag Description Static/Dynamic Reverse Auto-add _scc_s to all exported functions not marked INLINE dynamic Auto-add _scc_s to all top-level functions not marked INLINE dynamic Auto-add _scc_s to all CAFs dynamic Turn on profiling static - Turn on ticky-ticky profiling static - Program coverage options Flag Description Static/Dynamic Reverse Turn on Haskell program coverage instrumentation static Directory to deposit .mix files during compilation (default is .hpc) dynamic Haskell pre-processor options Flag Description Static/Dynamic Reverse Enable the use of a pre-processor (set with ) dynamic - C pre-processor options Flag Description Static/Dynamic Reverse Run the C pre-processor on Haskell source files dynamic - symbol=value Define a symbol in the C pre-processor dynamic symbol symbol Undefine a symbol in the C pre-processor dynamic - dir Add dir to the directory search list for #include files dynamic - Code generation options Flag Description Static/Dynamic Reverse Use the native code generator dynamic -fvia-C Compile via C dynamic -fasm Omit code generation dynamic - Generate byte-code dynamic - Generate object code dynamic - Linking options Flag Description Static/Dynamic Reverse Generate 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 - name On Darwin/MacOS X only, link in the framework name. This option corresponds to the option for Apple's Linker. dynamic - name On 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 - lib Link in library lib dynamic - dir Add dir to the list of directories searched for libraries dynamic - Set main module and function dynamic - DLL-creation mode (Windows only) dynamic - Don't assume this program contains main dynamic - 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 linking dynamic - Split objects (for libraries) dynamic - Use static Haskell libraries static - Use the threaded runtime static - Use the debugging runtime static - Enable runtime event tracing static - 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 - path Set 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 phases Flag Description Static/Dynamic Reverse cmd Use cmd as the literate pre-processor dynamic - cmd Use cmd as the C pre-processor (with only) dynamic - cmd Use cmd as the C compiler dynamic - cmd Use cmd as the mangler dynamic - cmd Use cmd as the splitter dynamic - cmd Use cmd as the assembler dynamic - cmd Use cmd as the linker dynamic - cmd Use cmd as the DLL generator dynamic - cmd Use cmd as the pre-processor (with only) dynamic - cmd Use cmd as the program for embedding manifests on Windows. dynamic - Forcing options to particular phases Flag Description Static/Dynamic Reverse option pass option to the literate pre-processor dynamic - option pass option to cpp (with only) dynamic - option pass option to the custom pre-processor dynamic - option pass option to the C compiler dynamic - option pass option to the mangler dynamic - option pass option to the assembler dynamic - option pass option to the linker dynamic - option pass option to the DLL generator dynamic - option pass option to windres. dynamic - Platform-specific options Flag Description Static/Dynamic Reverse (x86 only) Use SSE2 for floating point dynamic - (x86 only) give some registers back to the C compiler dynamic - External core file options Flag Description Static/Dynamic Reverse Generate .hcr external Core files dynamic - Compiler debugging options Flag Description Static/Dynamic Reverse Turn on internal sanity checking dynamic - Dump assembly dynamic - Dump interpreter byte code dynamic - Dump C-- output dynamic - Dump output from CPR analysis dynamic - Dump CSE output dynamic - Dump deriving output dynamic - Dump desugarer output dynamic - Dump “flat” C dynamic - Dump foreign export stubs dynamic - Dump after instrumentation for program coverage dynamic - Dump inlining info dynamic - Dump occurrence analysis output dynamic - Dump the results of C-- to C-- optimising passes dynamic - Dump parse tree dynamic - Dump prepared core dynamic - Dump renamer output dynamic - Dump rules dynamic - Dump final simplifier output dynamic - Dump output from each simplifier phase dynamic - Dump output from each simplifier iteration dynamic - Dump specialiser output dynamic - Dump TH spliced expressions, and what they evaluate to dynamic - Dump final STG dynamic - Dump strictness analyser output dynamic - Dump typechecker output dynamic - Dump type signatures dynamic - Dump worker-wrapper output dynamic - Trace interface files dynamic - Trace typechecker dynamic - Trace renamer dynamic - Renamer stats dynamic - Dump simplifier stats dynamic - Suppress unsolicited debugging output static - 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 dumps static - Set the depth for printing expressions in error msgs static - Dump haskell source stats dynamic - C-- pass sanity checking dynamic - STG pass sanity checking dynamic - Dump STG stats dynamic - Show output from each core-to-core pass dynamic - Show output from each STG-to-STG pass dynamic - Print out each pass name as it happens dynamic - Show statistics for fast string usage when finished dynamic - Misc compiler options Flag Description Static/Dynamic Reverse Don't complain about .hi file mismatches static - Turn off black holing (probably doesn't work) static - Set simplification history size static - Unregisterised compilation (use instead) static - Turn off assembly mangling (use instead) dynamic -