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). Verbosity options More details in Flag Description Static/Dynamic Reverse verbose mode (equivalent to ) dynamic - n set verbosity level dynamic - print explicit forall quantification in types dynamic -fno-print-explicit-foralls print explicit kind foralls and kind arguments in types dynamic -fno-print-explicit-kinds output full span in error messages dynamic - size Set the minimum heap size to size static - Summarise timing stats for GHC (same as +RTS -tstderr) static - Alternative modes of operation More details in Flag Description Static/Dynamic Reverse , Disply help mode - 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 - Display the contents of an interface file. mode - Generate dependency information suitable for use in a Makefile; see for details. mode - , display the supported language extensions mode - display the supported command line options mode - display information about the compiler mode - display GHC version mode - display GHC version (numeric only) mode - display GHC library directory mode - 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 - 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 redirect dump files dynamic - dir set output directory dynamic - Keeping intermediate files Flag Description Static/Dynamic Reverse or retain intermediate .hc files dynamic - or retain intermediate LLVM .ll files dynamic - or retain intermediate .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. This is implied by any option when compiling a single file (i.e. when using -c). dynamic Interactive-mode options Flag Description Static/Dynamic Reverse Disable reading of .ghci files dynamic - Read additional .ghci files dynamic - Break on any exception thrown dynamic Break on uncaught exceptions and errors dynamic Set the number of entries GHCi keeps for :history 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 - Select the function to use for printing evaluated expressions in GHCi dynamic - Packages Flag Description Static/Dynamic Reverse P Compile to be part of package P static - 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 Add 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 base and rts packages. dynamic - P Expose package P and set it to be trusted static/:set - P Expose package P and set it to be distrusted static/:set - Distrust all packages by default static/:set - 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 n set the limit for context reduction. Default is 20. dynamic Deprecated. Enable most language extensions; see for exactly which ones. dynamic Make tuple pattern matching irrefutable dynamic Enable Safe Haskell trusted package requirement for trustworthy modules. dynamic n set the limit for type function reductions. Default is 200. dynamic Allow the user to write ambiguous types, and the type inference engine to infer them. dynamic Enable arrow notation extension dynamic Automatically derive Typeable instances for every datatype and type class declaration. Implies . dynamic Enable bang patterns. dynamic Enable support for binary literals. dynamic Enable the CAPI calling convention. dynamic Enable constrained class methods. dynamic Enable a kind of constraints. dynamic Enable the C preprocessor. dynamic Enable datatype promotion. dynamic Enable default signatures. dynamic Enable deriving for the Data and Typeable classes. Implied by . dynamic Enable deriving for the Functor class. Implied by . dynamic Enable deriving for the Foldable class. Implied by . dynamic Enable deriving for the Generic class. dynamic Enable deriving for the Traversable class. Implies and . dynamic Enable record field disambiguation. Implied by . dynamic Allow empty case alternatives. dynamic Enable empty data declarations. dynamic Enable existential quantification. dynamic Enable explicit universal quantification. Implied by , , and . dynamic Enable using the keyword type to specify the namespace of entries in imports and exports (). Implied by and . dynamic Use GHCi's extended default rules in a normal module. dynamic Enable flexible contexts. Implied by . dynamic Enable flexible instances. Implies . Implied by . dynamic Enable foreign function interface. dynamic Enable functional dependencies. Implies . dynamic Enable generalised algebraic data types. Implies and . dynamic Enable generalised algebraic data type syntax. dynamic Enable newtype deriving. dynamic Deprecated, does nothing. No longer enables generic classes. See also GHC's support for generic programming. dynamic Enable Implicit Parameters. Implies and . dynamic Don't implicitly import Prelude. Implied by . dynamic Enable impredicative types. Implies . dynamic Enable incoherent instances. Implies . dynamic Enable instance signatures. dynamic Enable interruptible FFI. dynamic Enable kind signatures. Implied by and . dynamic Enable lambda-case expressions. dynamic Enable liberalised type synonyms. dynamic Allow "#" as a postfix modifier on identifiers. dynamic Enable monad comprehensions. dynamic Enable do not generalise local bindings. Implied by and . dynamic Disable the monomorphism restriction. dynamic Enable multi parameter type classes. Implied by . dynamic Enable multi-way if-expressions. dynamic Enable record puns. dynamic Enable support for negative literals. dynamic Disable support for n+k patterns. dynamic Deprecated, does nothing. nullary (no parameter) type classes are now enabled using . dynamic Enable support for 'fractional' integer literals. dynamic Enable overlapping instances. dynamic Enable overloaded lists. dynamic Enable overloaded string literals. dynamic Enable package-qualified imports. dynamic Enable parallel arrays. Implies . dynamic Enable parallel list comprehensions. Implied by . dynamic Enable pattern guards. dynamic Enable pattern synonyms. dynamic Enable kind polymorphism. Implies . dynamic Enable polymorphic components for data constructors. dynamic, synonym for Enable postfix operators. dynamic Enable quasiquotation. dynamic Enable rank-2 types. dynamic, synonym for Enable rank-N types. Implied by . dynamic Employ rebindable syntax. Implies . dynamic Enable record wildcards. Implies . dynamic Enable recursive do (mdo) notation. dynamic (deprecated) Relaxed checking for mutually-recursive polymorphic functions. dynamic Enable role annotations. dynamic Enable the Safe Haskell Safe mode. dynamic Enable lexically-scoped type variables. dynamic Enable standalone deriving. dynamic Enable Template Haskell. dynamic Disable support for traditional record syntax (as supported by Haskell 98) C {f = x} dynamic Enable generalised list comprehensions. dynamic Enable the Safe Haskell Trustworthy mode. dynamic Enable tuple sections. dynamic Enable type families. Implies , and . dynamic Enable type operators. Implies . dynamic Enable type synonyms in instance heads. Implied by . dynamic Enable unboxed tuples. dynamic Enable undecidable instances. dynamic Enable unicode syntax. dynamic Enable unlifted FFI types. dynamic Enable Safe Haskell Unsafe mode. dynamic Enable view patterns. 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 Defer as many type errors as possible until runtime. dynamic Make suggestions for mis-spelled names. dynamic warn about uses of commandline flags that are deprecated dynamic warn when a constraint appears duplicated in a type signature dynamic warn when an entity is exported multiple times dynamic warn when a .hi file in the current directory shadows a library dynamic warn about uses of Prelude numeric conversions that are probably the identity (and hence could be omitted) dynamic warn when the Prelude is implicitly imported dynamic warn when a pattern match could fail dynamic warn when a pattern match in a lambda expression or pattern binding could fail dynamic warn when a record update could fail dynamic (deprecated) warn when a pattern binding looks lazy but must be strict dynamic warn when fields of a record are uninitialised dynamic warn when an import declaration does not explicitly list all the names brought into scope dynamic warn when class methods are undefined dynamic warn about top-level functions without signatures dynamic warn about polymorphic local bindings without signatures dynamic warn when the Monomorphism Restriction is applied 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 if there are tabs in the source file dynamic warn when defaulting happens dynamic warn about uses of pragmas that GHC doesn't recognise 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 warn if the module being compiled is regarded to be unsafe. Should be used to check the safety status of modules when using safe inference. dynamic warn if the module being compiled is regarded to be safe. Should be used to check the safety status of modules when using safe inference. dynamic warn about uses of functions & types that have warnings or deprecated pragmas dynamic (deprecated) warn on definitions conflicting with the Applicative-Monad Proposal (AMP) dynamic Enable holes in expressions. dynamic Optimisation levels These options are described in more detail in Flag Description Static/Dynamic Reverse Enable default optimisation (level 1) dynamic n Set optimisation level n dynamic Individual optimisations These options are described in more detail in . Flag Description Static/Dynamic Reverse Enable case-merging. Implied by . dynamic Turn on common sub-expression elimination. Implied by . dynamic Make dictionaries strict static Enable eta-reduction. Implied by . dynamic Enable lambda eta-reduction dynamic Turn on eager blackholing dynamic - Switch on all rewrite rules (including rules generated by automatic specialisation of overloaded functions). Implied by . dynamic Enable vectorisation of nested data parallelism dynamic Enable vectorisation avoidance (EXPERIMENTAL) dynamic Enable excess intermediate precision dynamic Turn on the float-in transformation. Implied by . dynamic Turn on full laziness (floating bindings outwards). Implied by . dynamic Allow worker-wrapper to convert a function closure into a thunk if the function does not use any of its arguments. Off by default. dynamic Ignore assertions in the source dynamic Ignore pragmas in interface files dynamic Turn saturated self-recursive tail-calls into local jumps in the generated assembly. dynamic Run demand analysis again, at the end of the simplification pipeline dynamic Turn on the liberate-case transformation. Implied by . dynamic -fno-liberate-case =n Set the size threshold for the liberate-case transformation to n (default: 200) static Set the maximum number of bindings to display in type error messages (default 6). dynamic Set the max iterations for the simplifier dynamic - If a worker has that many arguments, none will be unpacked anymore (default: 10) dynamic - Turn off the coercion optimiser static - Turn off pre-inlining 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 - Make GHC be more precise about its treatment of bottom (but see also ). In particular, GHC will not eta-expand through a case expression. dynamic Don't generate interface pragmas dynamic Set 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 =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 specialisation of overloaded functions. Implied by . dynamic Turn on strictness analysis. Implied by . dynamic =n Run an additional strictness analysis before simplifier phase n dynamic - Turn on the static argument transformation. Implied by . dynamic Flatten strict constructor fields dynamic Flatten strict constructor fields with a pointer-sized representation dynamic Tweak unfolding settings dynamic Tweak unfolding settings dynamic Tweak unfolding settings dynamic Tweak unfolding settings dynamic =n Set the maximum size of inline array allocations to n bytes (default: 128). GHC will allocate non-pinned arrays of statically known size in the current nursery block if they're no bigger than n bytes, ignoring GC overheap. This value should be quite a bit smaller than the block size (typically: 4096). dynamic - =n Inline memcpy calls if they would generate no more than n pseudo instructions (default: 32). dynamic - =n Inline memset calls if they would generate no more than n pseudo instructions (default: 32). dynamic - Profiling options Flag Description Static/Dynamic Reverse Turn on profiling static - Auto-add SCCs to all bindings not marked INLINE dynamic Auto-add SCCs to all top-level bindings not marked INLINE dynamic Auto-add SCCs to all exported bindings not marked INLINE dynamic Auto-add SCCs to all CAFs dynamic Do not collect entry counts dynamic Turn on ticky-ticky profiling static - Program coverage options Flag Description Static/Dynamic Reverse Turn on Haskell program coverage instrumentation dynamic 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 -fllvm Compile using the LLVM code generator dynamic -fasm Omit code generation dynamic - Always write interface files 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 - On Darwin/OS X/iOS only, generate a standalone static library (as opposed to an executable). This is the usual way to compile for iOS. dynamic - Generate position-independent code (where available) dynamic - Use dynamic Haskell libraries (if available) static - Build dynamic object files as well as static object files during compilation static - Set the output path for the dynamically linked objects static - Set the output suffix for dynamic object files static - Selects one of a number of modes for finding shared libraries at runtime. static - name On Darwin/OS X/iOS only, link in the framework name. This option corresponds to the option for Apple's Linker. dynamic - name On Darwin/OS X/iOS 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 - , 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 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/OS X only) dynamic - This instructs the linker to add all symbols, not only used ones, to the dynamic symbol table. Currently Linux and Windows/MinGW32 only. This is equivalent to using -optl -rdynamic on Linux, and -optl -export-all-symbols on Windows. dynamic - Plugin options Flag Description Static/Dynamic Reverse =module Load a plugin exported by a given module static - =module:args Give arguments to a plugin module; module must be specified with static - 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 LLVM optimiser dynamic - cmd Use cmd as the LLVM compiler 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 - cmd Use cmd as the command for libtool (with only). 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 LLVM optimiser dynamic - option pass option to the LLVM compiler 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 - Compiler debugging options Flag Description Static/Dynamic Reverse Turn on internal sanity checking dynamic - Dump to files instead of stdout dynamic - Dump assembly dynamic - Dump interpreter byte code dynamic - Dump C-- output dynamic - Print a one-line summary of the size of the Core program at the end of the optimisation pipeline 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 LLVM intermediate code 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 rule firing info dynamic - Dump detailed rule firing info dynamic - Dump rules dynamic - Dump vectoriser input and output 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 strictness signatures dynamic - Dump typechecker output dynamic - Dump type signatures dynamic - Dump worker-wrapper output dynamic - Trace interface files dynamic - Trace typechecker dynamic - Trace vectoriser dynamic - Trace renamer dynamic - Renamer stats dynamic - Dump simplifier stats dynamic - Suppress unsolicited debugging output static - Turn on debug printing (more verbose) static - Don't output pragma info in dumps static - Set the depth for printing expressions in error msgs dynamic - 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 suppressible. dynamic - Suppress the printing of uniques in debug output (easier to use diff) dynamic - Suppress extended information about identifiers where they are bound dynamic - Suppress the printing of module qualification prefixes dynamic - Suppress type signatures dynamic - Suppress type applications dynamic - Suppress the printing of coercions in Core dumps to make them shorter dynamic - 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 When compiling with --make, compile N modules in parallel. dynamic - Don't complain about .hi file mismatches static - Turn off black holing (probably doesn't work) static - Set simplification history size dynamic - 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 -