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 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 mode - Build a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than using make. mode - Evaluate expr mode - Generate dependency information suitable for use in a Makefile. 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 output directory 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 - Keeping intermediate files Flag Description Static/Dynamic Reverse retain intermediate .hc files dynamic - retain intermediate .s files dynamic - 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 dynamic - Empty the import directory list dynamic - 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 Read the interface in file and dump it as text to stdout. mode - 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 - Generate bytecode enabled for debugging dynamic - Do not include debugging information in bytecodes dynamic - Packages Flag Description Static/Dynamic Reverse P Compile to be part of package P dynamic - P Expose package P dynamic - Hide all packages by default static - name Hide package P dynamic - name Ignore package P dynamic - file Load more packages from file dynamic - Don't load the user's package config file. dynamic - Language options Flag Description Static/Dynamic Reverse Enable overlapping instances dynamic Enable incoherent instances. Implies dynamic Enable undecidable instances dynamic n set the limit for context reduction dynamic Enable arrow notation extension dynamic or Enable foreign function interface (implied by ) dynamic Enable generic classes dynamic Enable most language extensions dynamic Enable Implicit Parameters. Implied by . dynamic Make tuple pattern matching irrefutable dynamic Don't implicitly import Prelude dynamic Disable the monomorphism restriction dynamic Make pattern bindings polymorphic dynamic Use GHCi's extended default rules in a normal module dynamic Enable lexically-scoped type variables. Implied by . dynamic Enable Template Haskell. No longer implied by . dynamic Enable bang patterns. dynamic Warnings Flag Description Static/Dynamic Reverse enable normal warnings dynamic disable all warnings dynamic - enable all warnings dynamic make warnings fatal dynamic warn about uses of functions & types 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 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 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 when defaulting happens dynamic warn about bindings that are unused dynamic warn about unnecessary imports dynamic warn about variables in patterns that aren't used 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 dynamic Make dictionaries strict static Enable eta-reduction dynamic Enable lambda eta-reduction dynamic Enable excess intermediate precision dynamic Switch off all rewrite rules (including rules generated by automatic specialisation of overloaded functions) static Ignore assertions in the source dynamic Ignore pragmas in interface files dynamic Tweak the liberate-case optimisation (default: 10) static Don't generate interface pragmas dynamic If a worker has that many arguments, none will be unpacked anymore (default: 10) static - 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 off common sub-expression dynamic - Turn off full laziness (floating bindings outwards). dynamic -ffull-laziness Turn off pre-inlining static - Turn off strictness analysis dynamic - Flatten strict constructor fields dynamic Tweak unfolding settings static Tweak unfolding settings static Tweak unfolding settings static Tweak unfolding settings static Tweak unfolding settings static Profiling options Flag Description Static/Dynamic Reverse Auto-add _scc_s to all exported functions static Auto-add _scc_s to all top-level functions static Auto-add _scc_s to all CAFs static Turn on profiling static - Turn on ticky-ticky profiling static - 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 - C compiler options Flag Description Static/Dynamic Reverse file Include file when compiling the .hc file 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 mode - Linking options Flag Description Static/Dynamic Reverse Generate position-independent code (where available) static - Use dynamic Haskell libraries (if available) 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 function dynamic - DLL-creation mode (Windows only) dynamic - Don't assume this program contains main dynamic - Omit linking dynamic - Split objects (for libraries) dynamic - Use static Haskell libraries static - Use the threaded runtime static - Use the debugging runtime 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 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 - 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 the dependency generator dynamic - Platform-specific options Flag Description Static/Dynamic Reverse (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 static - 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 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 iteration dynamic - Dump specialiser output dynamic - Dump TH splided 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 - Turn on debug printing (more verbose) 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 - Enable unregisterised compilation static - 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 - Don't share specialisations of overloaded functions static - Set simplification history size static - Unregisterised compilation (use instead) static - Turn off assembly mangling (use instead) dynamic - Turn off printing of binding results in GHCi dynamic -