1GHC(1)                     Glasgow Haskell Compiler                     GHC(1)
2
3
4

NAME

6       ghc - the Glasgow Haskell Compiler
7

SYNOPSIS

9          ghc [option|filename]
10          ghci [option|filename]
11

DESCRIPTION

13       This manual page documents briefly the ghc and ghci commands. Note that
14       ghci is not yet available on all architectures. Extensive documentation
15       is  available  in  various  other  formats including PDF <https://down
16       loads.haskell.org/ghc/latest/docs/users_guide.pdf>       and       HTML
17       <https://downloads.haskell.org/ghc/latest/docs/html/>.
18
19       Each  of  GHC's  command line options is classified as either static or
20       dynamic. A static flag may only  be  specified  on  the  command  line,
21       whereas  a  dynamic  flag  may  also be given in an OPTIONS pragma in a
22       source file or set from the GHCi command-line with :set .
23
24       As a rule of thumb, all the language options are dynamic,  as  are  the
25       warning options and the debugging options.
26
27       The  rest  are  static, with the notable exceptions of -v, -cpp, -fasm,
28       -fvia-C, -fllvm, and -#include.  The OPTIONS sections lists the  status
29       of each flag.
30
31       Common suffixes of file names for Haskell are:
32
33       .hs    Haskell source code; preprocess, compile
34
35       .lhs   literate Haskell source; unlit, preprocess, compile
36
37       .hi    Interface file; contains information about exported symbols
38
39       .hc    intermediate C files
40
41       .⟨way⟩_o
42              object files for "way" ⟨way⟩; common ways are:
43
44              dyn    dynamically-linked
45
46              p      built with profiling
47
48       .⟨way⟩_hi
49              interface files for "way" ⟨way⟩; common ways are:
50

OPTIONS

52       Code generation
53              -dynamic-too   -fasm   -fllvm   -fbyte-code  -fbyte-code-and-ob‐
54              ject-code   -fexpose-internal-symbols    -fexternal-dynamic-refs
55              -fllvm   -fasm   -fno-code   -fobject-code  -fPIC  -fPIE  -fpre‐
56              fer-byte-code    -fwrite-if-simplified-core    -fwrite-interface
57              -split-objs
58
59       Debugging the compiler
60              -dasm-lint    -dcmm-lint    -dcore-lint    -ddisable-js-minifier
61              -ddump-asm       -ddump-asm-conflicts        -ddump-asm-liveness
62              -ddump-asm-native -ddump-asm-regalloc -ddump-asm-regalloc-stages
63              -ddump-asm-stats -ddump-bcos -ddump-c-backend  -ddump-call-arity
64              -ddump-cfg-weights   -ddump-cmm   -ddump-cmm-caf  -ddump-cmm-cbe
65              -ddump-cmm-cfg        -ddump-cmm-cps         -ddump-cmm-from-stg
66              -ddump-cmm-info          -ddump-cmm-opt          -ddump-cmm-proc
67              -ddump-cmm-procmap -ddump-cmm-raw -ddump-cmm-sink  -ddump-cmm-sp
68              -ddump-cmm-split  -ddump-cmm-switch  -ddump-cmm-thread-sanitizer
69              -ddump-cmm-verbose -ddump-cmm-verbose-by-proc  -ddump-core-stats
70              -ddump-cpr-signatures  -ddump-cpranal -ddump-cs-trace -ddump-cse
71              -ddump-debug     -ddump-deriv     -ddump-ds     -ddump-ds-preopt
72              -ddump-ec-trace         -ddump-exitify        -ddump-faststrings
73              -ddump-file-prefix=⟨str⟩     -ddump-float-in      -ddump-foreign
74              -ddump-full-laziness   -ddump-float-out   -ddump-hie  -ddump-hpc
75              -ddump-if-trace    -ddump-inlinings    -ddump-js     -ddump-json
76              -ddump-late-cc  -ddump-liberate-case  -ddump-llvm -ddump-mod-map
77              -ddump-occur-anal -ddump-opt-cmm -ddump-parsed -ddump-parsed-ast
78              -ddump-prep      -ddump-rn     -ddump-rn-ast     -ddump-rn-stats
79              -ddump-rn-trace         -ddump-rtti          -ddump-rule-firings
80              -ddump-rule-rewrites  -ddump-rules -ddump-simpl -ddump-simpl-it‐
81              erations   -ddump-simpl-stats   -ddump-simpl-trace   -ddump-spec
82              -ddump-spec-constr  -ddump-splices -ddump-static-argument-trans‐
83              formation     -ddump-stg     -ddump-stg-cg      -ddump-stg-final
84              -ddump-stg-from-core     -ddump-stg-tags     -ddump-stg-unarised
85              -ddump-str-signatures  -ddump-stranal  -ddump-tc   -ddump-tc-ast
86              -ddump-tc-trace   -ddump-ticked   -ddump-timings  -ddump-to-file
87              -ddump-types  -ddump-verbose-inlinings  -ddump-view-pattern-com‐
88              moning  -ddump-worker-wrapper -dfaststring-stats -dhex-word-lit‐
89              erals -dinitial-unique=⟨s⟩ -dinline-check=⟨str⟩  -dkeep-comments
90              -dlinear-core-lint   -dlint   -dno-debug-output   -ddebug-output
91              -dno-typeable-binds -dppr-case-as-let -dppr-cols=⟨n⟩ -dppr-debug
92              -dppr-user-length  -drule-check=⟨str⟩  -dshow-passes  -dstg-lint
93              -dsuppress-all  -dsuppress-coercion-types   -dsuppress-coercions
94              -dsuppress-core-sizes  -dsuppress-idinfo  -dsuppress-module-pre‐
95              fixes   -dsuppress-stg-free-vars   -dsuppress-stg-reps    -dsup‐
96              press-ticks  -dsuppress-timestamps  -dsuppress-type-applications
97              -dsuppress-type-signatures     -dsuppress-unfoldings      -dsup‐
98              press-uniques     -dsuppress-var-kinds    -dtag-inference-checks
99              -dth-dec-file -dunique-increment=⟨i⟩ -dverbose-core2core  -dver‐
100              bose-stg2stg     -falignment-sanitisation     -fcatch-nonexhaus‐
101              tive-cases  -fcheck-prim-bounds  -fcmm-thread-sanitizer   -fdis‐
102              tinct-constructor-tables    -fdump-with-ways    -finfo-table-map
103              -fllvm-fill-undef-with-garbage    -fproc-alignment     -funopti‐
104              mized-core-for-interpreter -fno-unoptimized-core-for-interpreter
105              -g -g⟨n⟩
106
107       C pre-processor
108              -cpp -D⟨symbol⟩[=⟨value⟩] -U⟨symbol⟩ -I⟨dir⟩ -U⟨symbol⟩
109
110       Finding imports
111              -i -i⟨dir⟩[:⟨dir⟩]*
112
113       Interactive mode
114              -fbreak-on-error    -fno-break-on-error     -fbreak-on-exception
115              -fno-break-on-exception     -fbreak-points     -fno-break-points
116              -fghci-hist-size=⟨n⟩   -fghci-leak-check    -fno-ghci-leak-check
117              -fimplicit-import-qualified -fno-implicit-import-qualified -flo‐
118              cal-ghci-history  -fno-local-ghci-history   -fno-it   -fno-no-it
119              -fprint-bind-result                       -fno-print-bind-result
120              -fprint-evld-with-show -fshow-loaded-modules  -ghci-script  -ig‐
121              nore-dot-ghci -no-ignore-dot-ghci -interactive-print ⟨name⟩
122
123       Interface files
124              --show-iface ⟨file⟩ -ddump-hi -ddump-hi-diffs -ddump-minimal-im‐
125              ports
126
127       Keeping intermediate files
128              -keep-hc-file  -keep-hc-files  -keep-hi-files  -no-keep-hi-files
129              -keep-hscpp-file        -keep-hscpp-files        -keep-llvm-file
130              -keep-llvm-files  -keep-o-files  -no-keep-o-files   -keep-s-file
131              -keep-s-files -keep-tmp-files
132
133       Language options
134              -XAllowAmbiguousTypes  -XApplicativeDo  -XArrows  -XBangPatterns
135              -XBinaryLiterals -XBlockArguments -XCApiFFI  -XConstrainedClass‐
136              Methods  -XConstraintKinds -XCPP -XCUSKs -XDataKinds -XDatatype‐
137              Contexts -XDeepSubsumption -XDefaultSignatures  -XDeriveAnyClass
138              -XDeriveDataTypeable -XDeriveFoldable -XDeriveFunctor -XDeriveG‐
139              eneric  -XDeriveLift  -XDeriveTraversable   -XDerivingStrategies
140              -XDerivingVia -XDisambiguateRecordFields -XDuplicateRecordFields
141              -XEmptyCase  -XEmptyDataDecls   -XEmptyDataDeriving   -XExisten‐
142              tialQuantification  -XExplicitForAll  -XExplicitNamespaces -XEx‐
143              tendedDefaultRules -XExtendedLiterals -XFieldSelectors  -XFlexi‐
144              bleContexts    -XFlexibleInstances    -XForeignFunctionInterface
145              -XFunctionalDependencies -XGADTs -XGADTSyntax  -XGeneralisedNew‐
146              typeDeriving  -XGeneralizedNewtypeDeriving  -XGHC2021  -XGHCFor‐
147              eignImportPrim  -XHaskell2010   -XHaskell98   -XHexFloatLiterals
148              -XImplicitParams    -XImportQualifiedPost   -XImpredicativeTypes
149              -XIncoherentInstances     -XInstanceSigs      -XInterruptibleFFI
150              -XKindSignatures  -XLambdaCase  -XLexicalNegation -XLiberalType‐
151              Synonyms   -XLinearTypes    -XMagicHash    -XMonadComprehensions
152              -XMonoLocalBinds  -XMultiParamTypeClasses  -XMultiWayIf -XNamed‐
153              FieldPuns -XNamedWildCards  -XNegativeLiterals  -XNoImplicitPre‐
154              lude    -XNoMonomorphismRestriction   -XNondecreasingIndentation
155              -XNoPatternGuards  -XNoTraditionalRecordSyntax  -XNPlusKPatterns
156              -XNullaryTypeClasses  -XNumDecimals -XNumericUnderscores -XOver‐
157              lappingInstances  -XOverloadedLabels  -XOverloadedLists  -XOver‐
158              loadedRecordDot   -XOverloadedRecordUpdate   -XOverloadedStrings
159              -XPackageImports   -XParallelListComp    -XPartialTypeSignatures
160              -XPatternSynonyms  -XPolyKinds  -XPostfixOperators -XQualifiedDo
161              -XQuantifiedConstraints -XQuasiQuotes -XRank2Types  -XRankNTypes
162              -XRebindableSyntax -XRecordWildCards -XRecursiveDo -XRoleAnnota‐
163              tions -XSafe -XScopedTypeVariables -XStandaloneDeriving  -XStan‐
164              daloneKindSignatures   -XStarIsType   -XStaticPointers  -XStrict
165              -XStrictData -XTemplateHaskell -XTemplateHaskellQuotes  -XTrans‐
166              formListComp  -XTrustworthy  -XTupleSections  -XTypeAbstractions
167              -XTypeApplications -XTypeData -XTypeFamilies  -XTypeFamilyDepen‐
168              dencies   -XTypeInType   -XTypeOperators  -XTypeSynonymInstances
169              -XUnboxedSums -XUnboxedTuples -XUndecidableInstances  -XUndecid‐
170              ableSuperClasses  -XUnicodeSyntax  -XUnliftedDatatypes -XUnlift‐
171              edFFITypes -XUnliftedNewtypes -XUnsafe -XViewPatterns
172
173       Linking options
174              -c -debug -dylib-install-name ⟨path⟩ -dynamic -dynload -eventlog
175              -fcompact-unwind   -fkeep-cafs   -flink-rts  -fno-embed-manifest
176              -fno-gen-manifest -fno-shared-implib -framework  ⟨name⟩  -frame‐
177              work-path ⟨dir⟩ -fsplit-sections -split-sections -fno-split-sec‐
178              tions -fuse-rpaths -fwhole-archive-hs-libs  -L  ⟨dir⟩  -l  ⟨lib⟩
179              -main-is  ⟨thing⟩  -no-hs-main  -no-pie -pie -no-rtsopts-sugges‐
180              tions   -package   ⟨name⟩   -pie    -no-pie    -rdynamic    -rt‐
181              sopts[=⟨none|some|all|ignore|ignoreAll⟩]      -shared      -sin‐
182              gle-threaded  -threaded  -static  -staticlib   -threaded   -sin‐
183              gle-threaded -with-rtsopts=⟨opts⟩
184
185       Miscellaneous options
186              -ddump-mod-cycles     -fdefer-out-of-scope-variables    -fno-de‐
187              fer-out-of-scope-variables     -fdefer-type-errors      -fno-de‐
188              fer-type-errors -fdefer-typed-holes -fno-defer-typed-holes -fex‐
189              ternal-interpreter -ffamily-application-cache -fno-family-appli‐
190              cation-cache  -fglasgow-exts -fno-glasgow-exts -fno-safe-haskell
191              -ghcversion-file ⟨path to ghcversion.h⟩ -H ⟨size⟩ -hidden-module
192              ⟨module  name⟩  -j[⟨n⟩]  -jsem  -reexported-module ⟨module name⟩
193              -this-package-name  ⟨unit-id⟩  -unit  @⟨filename⟩   -working-dir
194              ⟨dir⟩
195
196       Modes of operation
197              --frontend  ⟨module⟩ --help -? --info --interactive --make --nu‐
198              meric-version   --print-booter-version    --print-build-platform
199              --print-c-compiler-flags           --print-c-compiler-link-flags
200              --print-debug-on  --print-global-package-db  --print-have-inter‐
201              preter  --print-have-native-code-generator --print-host-platform
202              --print-ld-flags    --print-leading-underscore    --print-libdir
203              --print-object-splitting-supported --print-project-git-commit-id
204              --print-project-version      --print-rts-ways      --print-stage
205              --print-support-smp   --print-tables-next-to-code   --print-tar‐
206              get-platform --print-unregisterised  --run  ⟨file⟩  --show-iface
207              ⟨file⟩  --show-options  --supported-extensions  --supported-lan‐
208              guages --version -V -e ⟨expr⟩ -M -shared
209
210       Individual optimizations
211              -fasm-shortcutting  -fno-asm-shortcutting  -fbinary-blob-thresh‐
212              old=⟨n⟩  -fblock-layout-cfg  -fno-block-layout-cfg  -fblock-lay‐
213              out-weightless     -fno-block-layout-weightless     -fblock-lay‐
214              out-weights    -fcall-arity    -fno-call-arity    -fcase-folding
215              -fno-case-folding   -fcase-merge   -fno-case-merge    -fcmm-con‐
216              trol-flow     -fno-cmm-control-flow     -fcmm-elim-common-blocks
217              -fno-cmm-elim-common-blocks       -fcmm-sink       -fno-cmm-sink
218              -fcmm-static-pred  -fno-cmm-static-pred  -fcore-constant-folding
219              -fno-core-constant-folding -fcpr-anal -fno-cpr-anal -fcross-mod‐
220              ule-specialise   -fno-cross-module-specialise   -fcse   -fno-cse
221              -fdicts-cheap -fno-dicts-cheap -fdicts-strict  -fno-dicts-strict
222              -fdmd-tx-dict-sel   -fno-dmd-tx-dict-sel   -fdmd-unbox-width=⟨n⟩
223              -fdo-eta-reduction -fno-do-eta-reduction  -fdo-lambda-eta-expan‐
224              sion   -fno-do-lambda-eta-expansion   -feager-blackholing  -fen‐
225              able-rewrite-rules -fno-enable-rewrite-rules  -fexcess-precision
226              -fno-excess-precision  -fexitification  -fno-exitification -fex‐
227              pose-all-unfoldings    -fno-expose-all-unfoldings     -ffloat-in
228              -fno-float-in  -ffull-laziness -fno-full-laziness -ffun-to-thunk
229              -fno-fun-to-thunk  -fignore-asserts  -fno-ignore-asserts   -fig‐
230              nore-interface-pragmas    -fno-ignore-interface-pragmas    -fin‐
231              line-generics   -fno-inline-generics   -finline-generics-aggres‐
232              sively     -fno-inline-generics-aggressively     -flate-dmd-anal
233              -fno-late-dmd-anal -flate-specialise -fno-late-specialise -flib‐
234              erate-case    -fno-liberate-case   -fliberate-case-threshold=⟨n⟩
235              -fno-liberate-case-threshold  -fllvm-pass-vectors-in-regs  -flo‐
236              cal-float-out  -fno-local-float-out  -flocal-float-out-top-level
237              -fno-local-float-out-top-level  -floopification  -fno-loopifica‐
238              tion  -fmax-inline-alloc-size=⟨n⟩  -fmax-inline-memcpy-insns=⟨n⟩
239              -fmax-inline-memset-insns=⟨n⟩    -fmax-simplifier-iterations=⟨n⟩
240              -fmax-uncovered-patterns=⟨n⟩  -fmax-worker-args=⟨n⟩ -fno-opt-co‐
241              ercion -fno-pre-inlining -fno-state-hack  -fomit-interface-prag‐
242              mas  -fno-omit-interface-pragmas  -fomit-yields -fno-omit-yields
243              -foptimal-applicative-do  -fno-optimal-applicative-do   -fpedan‐
244              tic-bottoms  -fno-pedantic-bottoms  -fpolymorphic-specialisation
245              -fno-polymorphic-specialisation   -fregs-graph   -fno-regs-graph
246              -fregs-iterative   -fno-regs-iterative   -fsimpl-tick-factor=⟨n⟩
247              -fsimplifier-phases=⟨n⟩  -fsolve-constant-dicts  -fno-solve-con‐
248              stant-dicts     -fspec-constr    -fno-spec-constr    -fspec-con‐
249              str-count=⟨n⟩     -fno-spec-constr-count      -fspec-constr-keen
250              -fno-spec-constr-keen -fspec-constr-threshold=⟨n⟩ -fno-spec-con‐
251              str-threshold -fspecialise -fno-specialise  -fspecialise-aggres‐
252              sively   -fno-specialise-aggressively   -fspecialise-incoherents
253              -fno-specialise-incoherents     -fstatic-argument-transformation
254              -fno-static-argument-transformation    -fstg-cse    -fno-stg-cse
255              -fstg-lift-lams     -fno-stg-lift-lams     -fstg-lift-lams-known
256              -fno-stg-lift-lams-known            -fstg-lift-lams-non-rec-args
257              -fstg-lift-lams-non-rec-args-any        -fstg-lift-lams-rec-args
258              -fstg-lift-lams-rec-args-any     -fstrictness    -fno-strictness
259              -fstrictness-before=⟨n⟩   -funbox-small-strict-fields   -fno-un‐
260              box-small-strict-fields      -funbox-strict-fields      -fno-un‐
261              box-strict-fields     -funfolding-case-scaling=⟨n⟩     -funfold‐
262              ing-case-threshold=⟨n⟩  -funfolding-creation-threshold=⟨n⟩ -fun‐
263              folding-dict-discount=⟨n⟩ -funfolding-fun-discount=⟨n⟩ -funfold‐
264              ing-keeness-factor=⟨n⟩             -funfolding-use-threshold=⟨n⟩
265              -fworker-wrapper -fworker-wrapper-cbv
266
267       Optimization levels
268              -O -O1 -O0 -O0 -O2 -O0 -O⟨n⟩ -O0
269
270       Package options
271              -clear-package-db -distrust ⟨pkg⟩ -distrust-all-packages -fpack‐
272              age-trust  -global-package-db  -hide-all-packages  -hide-package
273              ⟨pkg⟩     -ignore-package      ⟨pkg⟩      -no-auto-link-packages
274              -no-global-package-db  -no-user-package-db -package ⟨pkg⟩ -pack‐
275              age-db ⟨file⟩ -package-env ⟨file⟩|⟨name⟩  -package-id  ⟨unit-id⟩
276              -this-unit-id ⟨unit-id⟩ -trust ⟨pkg⟩ -user-package-db
277
278       Phases of compilation
279              --merge-objs -C -c -E -F -S -x ⟨suffix⟩
280
281       Overriding external programs
282              -pgma  ⟨cmd⟩ -pgmc ⟨cmd⟩ -pgmcxx ⟨cmd⟩ -pgmdll ⟨cmd⟩ -pgmF ⟨cmd⟩
283              -pgmi ⟨cmd⟩ -pgminstall_name_tool ⟨cmd⟩ -pgmL ⟨cmd⟩ -pgml  ⟨cmd⟩
284              -pgmlc  ⟨cmd⟩  -pgmlm  ⟨cmd⟩  -pgmlo ⟨cmd⟩ -pgmotool ⟨cmd⟩ -pgmP
285              ⟨cmd⟩ -pgms ⟨cmd⟩ -pgmwindres ⟨cmd⟩
286
287       Phase-specific options
288              -opta ⟨option⟩ -optc ⟨option⟩ -optcxx  ⟨option⟩  -optF  ⟨option⟩
289              -opti  ⟨option⟩  -optL  ⟨option⟩  -optl ⟨option⟩ -optlc ⟨option⟩
290              -optlm ⟨option⟩ -optlo ⟨option⟩ -optP ⟨option⟩ -optwindres  ⟨op‐
291              tion⟩ -pgmc-supports-no-pie -pgml-supports-no-pie
292
293       Platform-specific options
294              -mavx  -mavx2  -mavx512cd  -mavx512er -mavx512f -mavx512pf -mbmi
295              -mbmi2 -mfma -msse -msse2 -msse3 -msse4 -msse4.2
296
297       Compiler plugins
298              -fclear-plugins     -fplugin-library=⟨file-path⟩;⟨unit-id⟩;⟨mod‐
299              ule⟩;⟨args⟩   -fplugin-opt=⟨module⟩:⟨args⟩  -fplugin-trustworthy
300              -fplugin=⟨module⟩   -hide-all-plugin-packages    -plugin-package
301              ⟨pkg⟩ -plugin-package-id ⟨pkg-id⟩
302
303       Profiling
304              -auto       -auto-all      -caf-all      -fno-prof-count-entries
305              -fprof-count-entries         -fprof-auto          -fno-prof-auto
306              -fprof-auto-calls       -fno-prof-auto      -fprof-auto-exported
307              -fno-prof-auto   -fprof-auto-top   -fno-prof-auto    -fprof-cafs
308              -fno-prof-cafs  -fprof-callers=⟨name⟩ -fprof-late -fno-prof-late
309              -fprof-late-inline      -fno-prof-late-inline      -fprof-manual
310              -fno-prof-manual  -no-auto -no-auto-all -no-caf-all -prof -ticky
311              -ticky-allocd   -ticky-ap-thunk   -ticky-dyn-thunk    -ticky-LNE
312              -ticky-tag-checks
313
314       Program coverage
315              -fhpc -hpcdir⟨dir⟩
316
317       Recompilation checking
318              -exclude-module=⟨file⟩  -fforce-recomp  -fno-force-recomp  -fig‐
319              nore-hpc-changes -fno-ignore-hpc-changes  -fignore-optim-changes
320              -fno-ignore-optim-changes -include-cpp-deps -include-pkg-deps
321
322       Redirecting output
323              -dep-makefile  ⟨file⟩  -dep-suffix ⟨suffix⟩ -dumpdir ⟨dir⟩ -dyn‐
324              hisuf ⟨suffix⟩ -dyno ⟨file⟩  -dynohi  ⟨file⟩  -dynosuf  ⟨suffix⟩
325              -hcsuf  ⟨suffix⟩  -hidir  ⟨dir⟩  -hiedir  ⟨dir⟩ -hiesuf ⟨suffix⟩
326              -hisuf ⟨suffix⟩ -o ⟨file⟩ -odir ⟨dir⟩ -ohi ⟨file⟩ -osuf ⟨suffix⟩
327              -outputdir ⟨dir⟩ -stubdir ⟨dir⟩
328
329       Temporary files
330              -tmpdir ⟨dir⟩
331
332       Verbosity options
333              -fabstract-refinement-hole-fits            -fno-abstract-refine‐
334              ment-hole-fits   -fdefer-diagnostics    -fdiagnostics-color=⟨al‐
335              ways|auto|never⟩      -fdiagnostics-show-caret     -fno-diagnos‐
336              tics-show-caret -ferror-spans  -fhide-source-paths  -fkeep-going
337              -fmax-refinement-hole-fits=⟨n⟩     -fno-max-refinement-hole-fits
338              -fmax-relevant-binds=⟨n⟩                 -fno-max-relevant-binds
339              -fmax-valid-hole-fits=⟨n⟩               -fno-max-valid-hole-fits
340              -fno-show-valid-hole-fits              -fno-sort-valid-hole-fits
341              -fsort-valid-hole-fits    -fprint-axiom-incomps   -fno-print-ax‐
342              iom-incomps -fprint-equality-relations -fno-print-equality-rela‐
343              tions   -fprint-expanded-synonyms   -fno-print-expanded-synonyms
344              -fprint-explicit-coercions         -fno-print-explicit-coercions
345              -fprint-explicit-foralls -fno-print-explicit-foralls -fprint-ex‐
346              plicit-kinds   -fno-print-explicit-kinds   -fprint-explicit-run‐
347              time-reps -fno-print-explicit-runtime-reps -fprint-potential-in‐
348              stances -fno-print-potential-instances  -fprint-redundant-promo‐
349              tion-ticks   -fno-print-redundant-promotion-ticks  -fprint-type‐
350              checker-elaboration           -fno-print-typechecker-elaboration
351              -fprint-unicode-syntax    -fno-print-unicode-syntax    -frefine‐
352              ment-level-hole-fits=⟨n⟩  -fno-refinement-level-hole-fits  -fre‐
353              verse-errors     -fno-reverse-errors    -fshow-docs-of-hole-fits
354              -fno-show-docs-of-hole-fits  -fshow-error-context  -fno-show-er‐
355              ror-context                              -fshow-hole-constraints
356              -fshow-hole-matches-of-hole-fits
357              -fno-show-hole-matches-of-hole-fits                -fshow-prove‐
358              nance-of-hole-fits             -fno-show-provenance-of-hole-fits
359              -fshow-type-app-of-hole-fits     -fno-show-type-app-of-hole-fits
360              -fshow-type-app-vars-of-hole-fits
361              -fno-show-type-app-vars-of-hole-fits    -fshow-type-of-hole-fits
362              -fno-show-type-of-hole-fits             -fsort-by-size-hole-fits
363              -fno-sort-by-size-hole-fits      -fsort-by-subsumption-hole-fits
364              -fno-sort-by-subsumption-hole-fits   -funclutter-valid-hole-fits
365              -Rghc-timing -v -v⟨n⟩
366
367       Warnings
368              -fenable-th-splice-warnings       -fno-enable-th-splice-warnings
369              -fhelpful-errors  -fno-helpful-errors   -fmax-pmcheck-models=⟨n⟩
370              -fshow-warning-groups    -fno-show-warning-groups   -fvia-C   -W
371              -Wno-extra  -w   -Wall   -Wno-all   -Wall-missed-specialisations
372              -Wno-all-missed-specialisations     -Wall-missed-specializations
373              -Wno-all-missed-specializations  -Wambiguous-fields   -Wauto-or‐
374              phans    -Wcompat    -Wno-compat    -Wcompat-unqualified-imports
375              -Wno-compat-unqualified-imports -Wcpp-undef  -Wdefault  -Wno-de‐
376              fault         -Wdeferred-out-of-scope-variables         -Wno-de‐
377              ferred-out-of-scope-variables  -Wdeferred-type-errors   -Wno-de‐
378              ferred-type-errors    -Wdeprecated-flags   -Wno-deprecated-flags
379              -Wdeprecations -Wno-deprecations -Wderiving-defaults -Wno-deriv‐
380              ing-defaults      -Wderiving-typeable     -Wno-deriving-typeable
381              -Wdodgy-exports    -Wno-dodgy-exports    -Wdodgy-foreign-imports
382              -Wno-dodgy-foreign-imports   -Wdodgy-imports  -Wno-dodgy-imports
383              -Wduplicate-constraints   -Wno-duplicate-constraints    -Wdupli‐
384              cate-exports     -Wno-duplicate-exports     -Wempty-enumerations
385              -Wno-empty-enumerations -Werror  -Wwarn  -Weverything  -w  -Wex‐
386              tended-warnings    -Wno-extended-warnings   -Wextra   -Wno-extra
387              -Wforall-identifier    -Wno-forall-identifier    -Wgadt-mono-lo‐
388              cal-binds        -Wno-gadt-mono-local-binds       -Whi-shadowing
389              -Wno-hi-shadowing     -Widentities     -Wno-identities     -Wim‐
390              plicit-kind-vars     -Wno-implicit-kind-vars     -Wimplicit-lift
391              -Wno-implicit-lift   -Wimplicit-prelude    -Wno-implicit-prelude
392              -Wimplicit-rhs-quantification   -Wno-implicit-rhs-quantification
393              -Winaccessible-code   -Wno-inaccessible-code    -Wincomplete-ex‐
394              port-warnings  -Wno-incomplete-export-warnings -Wincomplete-pat‐
395              terns    -Wno-incomplete-patterns    -Wincomplete-record-updates
396              -Wno-incomplete-record-updates         -Wincomplete-uni-patterns
397              -Wno-incomplete-uni-patterns -Winconsistent-flags -Wno-inconsis‐
398              tent-flags  -Winconsistent-flags  -Wno-inconsistent-flags  -Win‐
399              ferred-safe-imports       -Wno-inferred-safe-imports       -Win‐
400              line-rule-shadowing -Wno-inline-rule-shadowing -Winvalid-haddock
401              -Wno-invalid-haddock -Wloopy-superclass-solve  -Wno-loopy-super‐
402              class-solve      -Wmisplaced-pragmas      -Wno-misplaced-pragmas
403              -Wmissed-extra-shared-lib           -Wno-missed-extra-shared-lib
404              -Wmissed-specialisations             -Wno-missed-specialisations
405              -Wmissed-specializations   -Wno-missed-specializations   -Wmiss‐
406              ing-deriving-strategies -Wno-missing-deriving-strategies -Wmiss‐
407              ing-export-lists     -Wno-missing-export-lists     -Wmissing-ex‐
408              ported-pattern-synonym-signatures     -Wno-missing-exported-pat‐
409              tern-synonym-signatures -Wmissing-exported-signatures -Wno-miss‐
410              ing-exported-signatures -Wmissing-exported-sigs -Wno-missing-ex‐
411              ported-sigs   -Wmissing-fields    -Wno-missing-fields    -Wmiss‐
412              ing-home-modules     -Wno-missing-home-modules     -Wmissing-im‐
413              port-lists  -Wno-missing-import-lists  -Wmissing-kind-signatures
414              -Wno-missing-kind-signatures          -Wmissing-local-signatures
415              -Wno-missing-local-signatures  -Wmissing-local-sigs   -Wno-miss‐
416              ing-local-sigs  -Wmissing-methods  -Wno-missing-methods  -Wmiss‐
417              ing-monadfail-instances -Wno-missing-monadfail-instances -Wmiss‐
418              ing-pattern-synonym-signatures -Wno-missing-pattern-synonym-sig‐
419              natures        -Wmissing-poly-kind-signatures         -Wno-miss‐
420              ing-poly-kind-signatures              -Wmissing-role-annotations
421              -Wno-role-annotations-signatures     -Wmissing-safe-haskell-mode
422              -Wno-missing-safe-haskell-mode  -Wmissing-signatures  -Wno-miss‐
423              ing-signatures   -Wmissing-space-after-bang   -Wmonomorphism-re‐
424              striction     -Wno-monomorphism-restriction     -Wname-shadowing
425              -Wno-name-shadowing   -Wnoncanonical-monad-instances   -Wno-non‐
426              canonical-monad-instances     -Wnoncanonical-monadfail-instances
427              -Wno-noncanonical-monadfail-instances  -Wnoncanonical-monoid-in‐
428              stances    -Wno-noncanonical-monoid-instances   -Wnot   -Wopera‐
429              tor-whitespace    -Wno-operator-whitespace     -Woperator-white‐
430              space-ext-conflict  -Wno-operator-whitespace-ext-conflict  -Wor‐
431              phans -Wno-orphans -Woverflowed-literals  -Wno-overflowed-liter‐
432              als   -Woverlapping-patterns   -Wno-overlapping-patterns  -Wpar‐
433              tial-fields    -Wno-partial-fields     -Wpartial-type-signatures
434              -Wno-partial-type-signatures      -Wprepositive-qualified-module
435              -Wno-prepositive-qualified-module      -Wredundant-bang-patterns
436              -Wno-redundant-bang-patterns -Wredundant-constraints -Wno-redun‐
437              dant-constraints    -Wredundant-record-wildcards     -Wno-redun‐
438              dant-record-wildcards  -Wredundant-strictness-flags  -Wno-redun‐
439              dant-strictness-flags -Wsafe  -Wno-safe  -Wsemigroup  -Wno-semi‐
440              group       -Wsimplifiable-class-constraints      -Wno-simplifi‐
441              able-class-constraints      -Wstar-binder       -Wno-star-binder
442              -Wstar-is-type  -Wno-star-is-type  -Wtabs -Wno-tabs -Wterm-vari‐
443              able-capture   -Wtrustworthy-safe   -Wno-safe    -Wtype-defaults
444              -Wno-type-defaults -Wtype-equality-out-of-scope -Wno-type-equal‐
445              ity-out-of-scope              -Wtype-equality-requires-operators
446              -Wno-type-equality-requires-operators              -Wtyped-holes
447              -Wno-typed-holes       -Wunbanged-strict-patterns       -Wno-un‐
448              banged-strict-patterns -Wunicode-bidirectional-format-characters
449              -Wunrecognised-pragmas   -Wno-unrecognised-pragmas    -Wunrecog‐
450              nised-warning-flags   -Wno-unrecognised-warning-flags   -Wunsafe
451              -Wno-unsafe    -Wunsupported-calling-conventions     -Wno-unsup‐
452              ported-calling-conventions  -Wunsupported-llvm-version  -Wno-un‐
453              supported-llvm-version          -Wunticked-promoted-constructors
454              -Wno-unticked-promoted-constructors    -Wunused-binds   -Wno-un‐
455              used-binds -Wunused-do-bind -Wno-unused-do-bind -Wunused-foralls
456              -Wno-unused-foralls     -Wunused-imports     -Wno-unused-imports
457              -Wunused-local-binds  -Wno-unused-local-binds   -Wunused-matches
458              -Wno-unused-matches    -Wunused-packages    -Wno-unused-packages
459              -Wunused-pattern-binds                 -Wno-unused-pattern-binds
460              -Wunused-record-wildcards           -Wno-unused-record-wildcards
461              -Wunused-top-binds -Wno-unused-top-binds  -Wunused-type-patterns
462              -Wno-unused-type-patterns -Wwarn -Werror -Wwarnings-deprecations
463              -Wno-warnings-deprecations  -Wwrong-do-bind   -Wno-wrong-do-bind
464              -Wx-⟨category⟩ -Wno-x-⟨category⟩
465
466   Code generation
467       -dynamic-too
468              Build dynamic object files as well as static object files during
469              compilation
470
471       -fasm  Use the native code generator
472
473       -fbyte-code
474              Generate byte-code
475
476       -fbyte-code-and-object-code
477              Generate object code and byte-code
478
479       -fexpose-internal-symbols
480              Produce symbols for all functions, including internal functions.
481
482       -fexternal-dynamic-refs
483              Generate code for linking against dynamic libraries
484
485       -fllvm Compile using the LLVM code generator
486
487       -fno-code
488              Omit code generation
489
490       -fobject-code
491              Generate object code
492
493       -fPIC  Generate position-independent code (where available)
494
495       -fPIE  Generate  code  for  a  position-independent  executable  (where
496              available)
497
498       -fprefer-byte-code
499              Use byte-code if it is available to evaluate TH splices
500
501       -fwrite-if-simplified-core
502              Write  an  interface  file containing the simplified core of the
503              module.
504
505       -fwrite-interface
506              Always write interface files
507
508       -split-objs
509              Split generated object files into smaller files
510
511   Debugging the compiler
512       -dasm-lint
513              ASM pass sanity checking
514
515       -dcmm-lint
516              C-\- pass sanity checking
517
518       -dcore-lint
519              Turn on internal sanity checking
520
521       -ddisable-js-minifier
522              Generate pretty-printed  JavaScript  code  instead  of  minified
523              (compacted) code.
524
525       -ddump-asm
526              Dump final assembly
527
528       -ddump-asm-conflicts
529              Dump register conflicts from the register allocator.
530
531       -ddump-asm-liveness
532              Dump assembly augmented with register liveness
533
534       -ddump-asm-native
535              Dump initial assembly
536
537       -ddump-asm-regalloc
538              Dump the result of register allocation
539
540       -ddump-asm-regalloc-stages
541              Dump the build/spill stages of the -fregs-graph register alloca‐
542              tor.
543
544       -ddump-asm-stats
545              Dump statistics from the register allocator.
546
547       -ddump-bcos
548              Dump interpreter byte code
549
550       -ddump-c-backend
551              Dump C code produced by the C (unregisterised) backend.
552
553       -ddump-call-arity
554              Dump output of the call arity analysis pass.
555
556       -ddump-cfg-weights
557              Dump the assumed weights of the CFG.
558
559       -ddump-cmm
560              Dump the final C-\- output
561
562       -ddump-cmm-caf
563              Dump the results of the C-\- CAF analysis pass.
564
565       -ddump-cmm-cbe
566              Dump the results of common block elimination
567
568       -ddump-cmm-cfg
569              Dump the results of the C-\- control flow optimisation pass.
570
571       -ddump-cmm-cps
572              Dump the results of the CPS pass
573
574       -ddump-cmm-from-stg
575              Dump STG-to-C-\- output
576
577       -ddump-cmm-info
578              Dump the results of the C-\- info table augmentation pass.
579
580       -ddump-cmm-opt
581              Dump the results of C-\- to C-\- optimising passes
582
583       -ddump-cmm-proc
584              Dump the results of proc-point analysis
585
586       -ddump-cmm-procmap
587              Dump the results of the C-\- proc-point map pass.
588
589       -ddump-cmm-raw
590              Dump raw C-\-
591
592       -ddump-cmm-sink
593              Dump the results of the C-\- sinking pass.
594
595       -ddump-cmm-sp
596              Dump the results of the C-\- stack layout pass.
597
598       -ddump-cmm-split
599              Dump the results of the C-\- proc-point splitting pass.
600
601       -ddump-cmm-switch
602              Dump the results of switch lowering passes
603
604       -ddump-cmm-thread-sanitizer
605              Dump the results of the C-\- ThreadSanitizer elaboration pass.
606
607       -ddump-cmm-verbose
608              Write output from main C-\- pipeline passes to files
609
610       -ddump-cmm-verbose-by-proc
611              Show output from main C-\- pipeline passes (grouped by proc)
612
613       -ddump-core-stats
614              Print a one-line summary of the size of the Core program at  the
615              end of the optimisation pipeline
616
617       -ddump-cpr-signatures
618              Dump CPR signatures
619
620       -ddump-cpranal
621              Dump CPR analysis output
622
623       -ddump-cs-trace
624              Trace constraint solver
625
626       -ddump-cse
627              Dump CSE output
628
629       -ddump-debug
630              Dump generated DWARF debug information
631
632       -ddump-deriv
633              Dump deriving output
634
635       -ddump-ds
636              Dump desugarer output.
637
638       -ddump-ec-trace
639              Trace exhaustiveness checker
640
641       -ddump-exitify
642              Dump output of the exitification pass.
643
644       -ddump-faststrings
645              Dump the whole FastString table when finished
646
647       -ddump-file-prefix=⟨str⟩
648              Set the prefix of the filenames used for debugging output.
649
650       -ddump-float-in
651              Dump float in output
652
653       -ddump-foreign
654              Dump foreign export stubs
655
656       -ddump-full-laziness
657              Dump full laziness pass output
658
659       -ddump-hie
660              Dump the hie file syntax tree
661
662       -ddump-hpc
663              An alias for -ddump-ticked.
664
665       -ddump-if-trace
666              Trace interface files
667
668       -ddump-inlinings
669              Dump inlinings performed by the simplifier.
670
671       -ddump-js
672              Dump final JavaScript code
673
674       -ddump-json
675              Dump error messages as JSON documents
676
677       -ddump-late-cc
678              Dump core with late cost centres added
679
680       -ddump-liberate-case
681              Dump liberate case output
682
683       -ddump-llvm
684              Dump LLVM intermediate code.
685
686       -ddump-mod-map
687              Dump the state of the module mapping database.
688
689       -ddump-occur-anal
690              Dump occurrence analysis output
691
692       -ddump-opt-cmm
693              Dump the results of C-\- to C-\- optimising passes
694
695       -ddump-parsed
696              Dump parse tree
697
698       -ddump-parsed-ast
699              Dump parser output as a syntax tree
700
701       -ddump-prep
702              Dump prepared core
703
704       -ddump-rn
705              Dump renamer output
706
707       -ddump-rn-ast
708              Dump renamer output as a syntax tree
709
710       -ddump-rn-stats
711              Renamer stats
712
713       -ddump-rn-trace
714              Trace renamer
715
716       -ddump-rtti
717              Trace runtime type inference
718
719       -ddump-rule-firings
720              Dump rule firing info
721
722       -ddump-rule-rewrites
723              Dump detailed rule firing info
724
725       -ddump-rules
726              Dump rewrite rules
727
728       -ddump-simpl
729              Dump final simplifier output
730
731       -ddump-simpl-iterations
732              Dump output from each simplifier iteration
733
734       -ddump-simpl-stats
735              Dump simplifier stats
736
737       -ddump-simpl-trace
738              Dump trace messages in simplifier
739
740       -ddump-spec
741              Dump specialiser output
742
743       -ddump-spec-constr
744              Dump specialiser output from SpecConstr
745
746       -ddump-splices
747              Dump TH spliced expressions, and what they evaluate to
748
749       -ddump-static-argument-transformation
750              Dump static argument transformation output
751
752       -ddump-stg
753              (deprecated) Alias for -ddump-stg-from-core
754
755       -ddump-stg-cg
756              Show output after Stg2Stg
757
758       -ddump-stg-final
759              Show output of last STG pass.
760
761       -ddump-stg-from-core
762              Show CoreToStg output
763
764       -ddump-stg-tags
765              Show output of the tag inference pass.
766
767       -ddump-stg-unarised
768              Show unarised STG
769
770       -ddump-str-signatures
771              Dump top-level demand signatures
772
773       -ddump-stranal
774              Dump demand analysis output
775
776       -ddump-tc
777              Dump typechecker output
778
779       -ddump-tc-ast
780              Dump typechecker output as a syntax tree
781
782       -ddump-tc-trace
783              Trace typechecker
784
785       -ddump-ticked
786              Dump the code instrumented by HPC (Observing Code Coverage).
787
788       -ddump-timings
789              Dump per-pass timing and allocation statistics
790
791       -ddump-to-file
792              Dump to files instead of stdout
793
794       -ddump-types
795              Dump type signatures
796
797       -ddump-verbose-inlinings
798              Dump all considered inlinings
799
800       -ddump-view-pattern-commoning
801              Dump commoned view patterns
802
803       -ddump-worker-wrapper
804              Dump worker-wrapper output
805
806       -dfaststring-stats
807              Show statistics for fast string usage when finished
808
809       -dhex-word-literals
810              Print values of type Word# in hexadecimal.
811
812       -dinitial-unique=⟨s⟩
813              Start UniqSupply allocation from ⟨s⟩.
814
815       -dinline-check=⟨str⟩
816              Dump information about inlining decisions
817
818       -dkeep-comments
819              Include  comments  in  the  parser.   Useful in combination with
820              -ddump-parsed-ast.
821
822       -dlinear-core-lint
823              Turn on internal sanity checking
824
825       -dlint Enable several common internal sanity checkers
826
827       -dno-debug-output
828              Suppress unsolicited debugging output
829
830       -dno-typeable-binds
831              Don't generate bindings for Typeable methods
832
833       -dppr-case-as-let
834              Print single alternative case expressions as strict lets.
835
836       -dppr-cols=⟨n⟩
837              Set the width of debugging output. For example -dppr-cols200
838
839       -dppr-debug
840              Turn on debug printing (more verbose)
841
842       -dppr-user-length
843              Set the depth for printing expressions in error msgs
844
845       -drule-check=⟨str⟩
846              Dump information about potential rule application
847
848       -dshow-passes
849              Print out each pass name as it happens
850
851       -dstg-lint
852              STG pass sanity checking
853
854       -dsuppress-all
855              In dumps, suppress everything (except for uniques) that is  sup‐
856              pressible.
857
858       -dsuppress-coercion-types
859              Suppress  the  printing  of coercion types in Core dumps to make
860              them shorter
861
862       -dsuppress-coercions
863              Suppress the printing of coercions in Core dumps  to  make  them
864              shorter
865
866       -dsuppress-core-sizes
867              Suppress the printing of core size stats per binding (since 9.4)
868
869       -dsuppress-idinfo
870              Suppress  extended  information about identifiers where they are
871              bound
872
873       -dsuppress-module-prefixes
874              Suppress the printing of module qualification prefixes
875
876       -dsuppress-stg-free-vars
877              Suppress the printing of closure free variable lists in STG out‐
878              put
879
880       -dsuppress-stg-reps
881              Suppress rep annotations on STG args.
882
883       -dsuppress-ticks
884              Suppress "ticks" in the pretty-printer output.
885
886       -dsuppress-timestamps
887              Suppress timestamps in dumps
888
889       -dsuppress-type-applications
890              Suppress type applications
891
892       -dsuppress-type-signatures
893              Suppress type signatures
894
895       -dsuppress-unfoldings
896              Suppress  the  printing of the stable unfolding of a variable at
897              its binding site
898
899       -dsuppress-uniques
900              Suppress the printing of uniques in debug output (easier to  use
901              diff)
902
903       -dsuppress-var-kinds
904              Suppress the printing of variable kinds
905
906       -dtag-inference-checks
907              Affirm tag inference results are correct at runtime.
908
909       -dth-dec-file
910              Dump evaluated TH declarations into *.th.hs files
911
912       -dunique-increment=⟨i⟩
913              Set the increment for the generated Unique's to ⟨i⟩.
914
915       -dverbose-core2core
916              Show output from each core-to-core pass
917
918       -dverbose-stg2stg
919              Show output from each STG-to-STG pass
920
921       -falignment-sanitisation
922              Compile with alignment checks for all info table dereferences.
923
924       -fcatch-nonexhaustive-cases
925              Add  a  default  error alternative to case expressions without a
926              default alternative.
927
928       -fcheck-prim-bounds
929              Instrument array primops with bounds checks.
930
931       -fcmm-thread-sanitizer
932              Enable ThreadSanitizer instrumentation of memory accesses.
933
934       -fdistinct-constructor-tables
935              Generate a fresh info table for each usage of a  data  construc‐
936              tor.
937
938       -fdump-with-ways
939              Include  the  tag  of  the enabled ways in the extension of dump
940              files.
941
942       -finfo-table-map
943              Embed a lookup table in the generated binary which maps the  ad‐
944              dress of an info table to the source position the closure origi‐
945              nated from.
946
947       -fllvm-fill-undef-with-garbage
948              Intruct LLVM to fill dead STG registers with garbage
949
950       -fproc-alignment
951              Align functions at given boundary.
952
953       -funoptimized-core-for-interpreter
954              Disable optimizations with the interpreter
955
956       -g     Produce DWARF debug information in compiled object  files.   ⟨n⟩
957              can  be 0, 1, or 2, with higher numbers producing richer output.
958              If ⟨n⟩ is omitted, level 2 is assumed.
959
960   C pre-processor
961       -cpp   Run the C pre-processor on Haskell source files
962
963       -D⟨symbol⟩[=⟨value⟩]
964              Define a symbol in the C pre-processor
965
966       -I⟨dir⟩
967              Add ⟨dir⟩ to the directory search list for #include files
968
969       -U⟨symbol⟩
970              Undefine a symbol in the C pre-processor
971
972   Finding imports
973       -i     Empty the import directory list
974
975       -i⟨dir⟩[:⟨dir⟩]*
976              add ⟨dir⟩, ⟨dir2⟩, etc. to import path
977
978   Interactive mode
979       -fbreak-on-error
980              Break on uncaught exceptions and errors
981
982       -fbreak-on-exception
983              Break on any exception thrown
984
985       -fbreak-points
986              Insert breakpoints in the GHCi debugger
987
988       -fghci-hist-size=⟨n⟩
989              Set the number of entries GHCi keeps for :history.  See The GHCi
990              Debugger.
991
992       -fghci-leak-check
993              (Debugging  only) check for space leaks when loading new modules
994              in GHCi.
995
996       -fimplicit-import-qualified
997              Put in scope qualified identifiers for every loaded module
998
999       -flocal-ghci-history
1000              Use  current  directory  for  the  GHCi  command  history   file
1001              .ghci-history.
1002
1003       -fno-it
1004              No longer set the special variable it.
1005
1006       -fprint-bind-result
1007              Turn on printing of binding results in GHCi
1008
1009       -fprint-evld-with-show
1010              Instruct :print to use Show instances where possible.
1011
1012       -fshow-loaded-modules
1013              Show  the  names  of modules that GHCi loaded after a :load com‐
1014              mand.
1015
1016       -ghci-script
1017              Read additional .ghci files
1018
1019       -ignore-dot-ghci
1020              Disable reading of .ghci files
1021
1022       -interactive-print ⟨name⟩
1023              Select the function to use for printing evaluated expressions in
1024              GHCi
1025
1026   Interface files
1027       --show-iface ⟨file⟩
1028              See Modes of operation.
1029
1030       -ddump-hi
1031              Dump the new interface to stdout
1032
1033       -ddump-hi-diffs
1034              Show the differences vs. the old interface
1035
1036       -ddump-minimal-imports
1037              Dump a minimal set of imports
1038
1039   Keeping intermediate files
1040       -keep-hc-file
1041              Retain intermediate .hc files.
1042
1043       -keep-hi-files
1044              Retain intermediate .hi files (the default).
1045
1046       -keep-hscpp-file
1047              Retain intermediate .hscpp files.
1048
1049       -keep-llvm-file
1050              Retain intermediate LLVM .ll files.  Implies -fllvm.
1051
1052       -keep-o-files
1053              Retain intermediate .o files (the default).
1054
1055       -keep-s-file
1056              Retain intermediate .s files.
1057
1058       -keep-tmp-files
1059              Retain all intermediate temporary files.
1060
1061   Language options
1062       -XAllowAmbiguousTypes
1063              Allow  the user to write ambiguous types, and the type inference
1064              engine to infer them.
1065
1066       -XApplicativeDo
1067              Enable Applicative do-notation desugaring
1068
1069       -XArrows
1070              Enable arrow notation extension
1071
1072       -XBangPatterns
1073              Enable bang patterns.
1074
1075       -XBinaryLiterals
1076              Enable support for binary literals.
1077
1078       -XBlockArguments
1079              Allow do blocks and other constructs as function arguments.
1080
1081       -XCApiFFI
1082              Enable the CAPI calling convention.
1083
1084       -XConstrainedClassMethods
1085              Enable constrained class methods.
1086
1087       -XConstraintKinds
1088              Enable a kind of constraints.
1089
1090       -XCPP  Enable the C preprocessor.
1091
1092       -XCUSKs
1093              Enable detection of complete user-supplied kind signatures.
1094
1095       -XDataKinds
1096              Enable datatype promotion.
1097
1098       -XDatatypeContexts
1099              Allow contexts on data types.
1100
1101       -XDeepSubsumption
1102              Enable deep subsumption
1103
1104       -XDefaultSignatures
1105              Enable default signatures.
1106
1107       -XDeriveAnyClass
1108              Enable deriving for any class.
1109
1110       -XDeriveDataTypeable
1111              Enable deriving for the Data class.
1112
1113       -XDeriveFoldable
1114              Enable  deriving   for   the   Foldable   class.    Implied   by
1115              DeriveTraversable.
1116
1117       -XDeriveFunctor
1118              Enable   deriving   for   the   Functor   class.    Implied   by
1119              DeriveTraversable.
1120
1121       -XDeriveGeneric
1122              Enable deriving for the Generic class.
1123
1124       -XDeriveLift
1125              Enable deriving for the Lift class
1126
1127       -XDeriveTraversable
1128              Enable   deriving   for   the   Traversable   class.     Implies
1129              DeriveFunctor and DeriveFoldable.
1130
1131       -XDerivingStrategies
1132              Enables deriving strategies.
1133
1134       -XDerivingVia
1135              Enable  deriving  instances via types of the same runtime repre‐
1136              sentation.  Implies DerivingStrategies.
1137
1138       -XDisambiguateRecordFields
1139              Enable record field disambiguation.  Implied by RecordWildCards.
1140
1141       -XDuplicateRecordFields
1142              Allow definition of record types with identically-named fields.
1143
1144       -XEmptyCase
1145              Allow empty case alternatives.
1146
1147       -XEmptyDataDecls
1148              Allow definition of empty data types.
1149
1150       -XEmptyDataDeriving
1151              Allow deriving instances of standard type classes for empty data
1152              types.
1153
1154       -XExistentialQuantification
1155              Enable liberalised type synonyms.
1156
1157       -XExplicitForAll
1158              Enable    explicit   universal   quantification.    Implied   by
1159              ScopedTypeVariables,   LiberalTypeSynonyms,    RankNTypes    and
1160              ExistentialQuantification.
1161
1162       -XExplicitNamespaces
1163              Enable  using  the  keyword type to specify the namespace of en‐
1164              tries in imports and exports (Explicit namespaces in  import/ex‐
1165              port).  Implied by TypeOperators and TypeFamilies.
1166
1167       -XExtendedDefaultRules
1168              Use GHCi's extended default rules in a normal module.
1169
1170       -XExtendedLiterals
1171              Enable numeric literal postfix syntax for unboxed integers.
1172
1173       -XFieldSelectors
1174              Control visibility of field selector functions.
1175
1176       -XFlexibleContexts
1177              Remove some restrictions on class contexts
1178
1179       -XFlexibleInstances
1180              Enable flexible instances.  Implies TypeSynonymInstances.
1181
1182       -XForeignFunctionInterface
1183              Enable foreign function interface.
1184
1185       -XFunctionalDependencies
1186              Enable functional dependencies.  Implies MultiParamTypeClasses.
1187
1188       -XGADTs
1189              Enable generalised algebraic data types.  Implies GADTSyntax and
1190              MonoLocalBinds.
1191
1192       -XGADTSyntax
1193              Enable generalised algebraic data type syntax.
1194
1195       -XGeneralisedNewtypeDeriving
1196              Enable newtype deriving.
1197
1198       -XGeneralizedNewtypeDeriving
1199              Enable newtype deriving.
1200
1201       -XGHC2021
1202              Use GHC’s set of default language extensions from 2021
1203
1204       -XGHCForeignImportPrim
1205              Enable prim calling convention. Intended for internal use only.
1206
1207       -XHaskell2010
1208              Use the Haskell 2010 language variant.
1209
1210       -XHaskell98
1211              Use the Haskell 98 language variant.
1212
1213       -XHexFloatLiterals
1214              Enable support for hexadecimal floating point literals.
1215
1216       -XImplicitParams
1217              Enable Implicit Parameters.
1218
1219       -XImportQualifiedPost
1220              ImportQualifiedPost allows the syntax import M qualified
1221
1222       -XImpredicativeTypes
1223              Enable impredicative types.  Implies RankNTypes.
1224
1225       -XIncoherentInstances
1226              Enable incoherent instances.  Implies OverlappingInstances.
1227
1228       -XInstanceSigs
1229              Enable instance signatures.
1230
1231       -XInterruptibleFFI
1232              Enable interruptible FFI.
1233
1234       -XKindSignatures
1235              Enable kind signatures.  Implied by TypeFamilies and PolyKinds.
1236
1237       -XLambdaCase
1238              Enable lambda-case expressions.
1239
1240       -XLexicalNegation
1241              Use whitespace to determine whether the minus  sign  stands  for
1242              negation or subtraction.
1243
1244       -XLiberalTypeSynonyms
1245              Enable liberalised type synonyms.
1246
1247       -XLinearTypes
1248              Enable linear types.
1249
1250       -XMagicHash
1251              Allow # as a postfix modifier on identifiers.
1252
1253       -XMonadComprehensions
1254              Enable monad comprehensions.
1255
1256       -XMonoLocalBinds
1257              Enable   do   not   generalise   local   bindings.   Implied  by
1258              TypeFamilies and GADTs.
1259
1260       -XMultiParamTypeClasses
1261              Enable   multi   parameter    type    classes.     Implied    by
1262              FunctionalDependencies.
1263
1264       -XMultiWayIf
1265              Enable multi-way if-expressions.
1266
1267       -XNamedFieldPuns
1268              Enable record puns.
1269
1270       -XNamedWildCards
1271              Enable named wildcards.
1272
1273       -XNegativeLiterals
1274              Enable support for negative literals.
1275
1276       -XNoImplicitPrelude
1277              Don't implicitly import Prelude.  Implied by RebindableSyntax.
1278
1279       -XNoMonomorphismRestriction
1280              Disable the monomorphism restriction.
1281
1282       -XNondecreasingIndentation
1283              Allow nested contexts to be at the same indentation level as its
1284              enclosing context.
1285
1286       -XNoPatternGuards
1287              Disable pattern guards.  Implied by Haskell98.
1288
1289       -XNoTraditionalRecordSyntax
1290              Disable support for traditional record syntax (as  supported  by
1291              Haskell 98) C {f = x}
1292
1293       -XNPlusKPatterns
1294              Enable support for n+k patterns.  Implied by Haskell98.
1295
1296       -XNullaryTypeClasses
1297              Deprecated,  does  nothing.  nullary (no parameter) type classes
1298              are now enabled using MultiParamTypeClasses.
1299
1300       -XNumDecimals
1301              Enable support for 'fractional' integer literals.
1302
1303       -XNumericUnderscores
1304              Enable support for numeric underscores.
1305
1306       -XOverlappingInstances
1307              Enable overlapping instances.
1308
1309       -XOverloadedLabels
1310              Enable overloaded labels.
1311
1312       -XOverloadedLists
1313              Enable overloaded lists.
1314
1315       -XOverloadedRecordDot
1316              Record '.' syntax
1317
1318       -XOverloadedRecordUpdate
1319              Record '.' syntax record updates
1320
1321       -XOverloadedStrings
1322              Enable overloaded string literals.
1323
1324       -XPackageImports
1325              Enable package-qualified imports.
1326
1327       -XParallelListComp
1328              Enable parallel list comprehensions.
1329
1330       -XPartialTypeSignatures
1331              Enable partial type signatures.
1332
1333       -XPatternSynonyms
1334              Enable pattern synonyms.
1335
1336       -XPolyKinds
1337              Enable kind polymorphism.  Implies KindSignatures.
1338
1339       -XPostfixOperators
1340              Enable postfix operators.
1341
1342       -XQualifiedDo
1343              Enable qualified do-notation desugaring.
1344
1345       -XQuantifiedConstraints
1346              Allow forall quantifiers in constraints.
1347
1348       -XQuasiQuotes
1349              Enable quasiquotation.
1350
1351       -XRank2Types
1352              Enable rank-2 types.  Synonym for RankNTypes.
1353
1354       -XRankNTypes
1355              Enable rank-N types.  Implied by ImpredicativeTypes.
1356
1357       -XRebindableSyntax
1358              Employ rebindable syntax.  Implies NoImplicitPrelude.
1359
1360       -XRecordWildCards
1361              Enable record wildcards.  Implies DisambiguateRecordFields.
1362
1363       -XRecursiveDo
1364              Enable recursive do (mdo) notation.
1365
1366       -XRoleAnnotations
1367              Enable role annotations.
1368
1369       -XSafe Enable the Safe Haskell Safe mode.
1370
1371       -XScopedTypeVariables
1372              Enable lexically-scoped type variables.
1373
1374       -XStandaloneDeriving
1375              Enable standalone deriving.
1376
1377       -XStandaloneKindSignatures
1378              Allow the use of standalone kind signatures.
1379
1380       -XStarIsType
1381              Treat * as Data.Kind.Type.
1382
1383       -XStaticPointers
1384              Enable static pointers.
1385
1386       -XStrict
1387              Make bindings in the current module strict by default.
1388
1389       -XStrictData
1390              Enable default strict datatype fields.
1391
1392       -XTemplateHaskell
1393              Enable Template Haskell.
1394
1395       -XTemplateHaskellQuotes
1396              Enable quotation subset of Template Haskell.
1397
1398       -XTransformListComp
1399              Enable generalised list comprehensions.
1400
1401       -XTrustworthy
1402              Enable the Safe Haskell Trustworthy mode.
1403
1404       -XTupleSections
1405              Enable tuple sections.
1406
1407       -XTypeAbstractions
1408              Enable type abstraction syntax in  patterns  and  type  variable
1409              binders.
1410
1411       -XTypeApplications
1412              Enable type application syntax in terms and types.
1413
1414       -XTypeData
1415              Enable type data declarations.
1416
1417       -XTypeFamilies
1418              Enable     type     families.     Implies    ExplicitNamespaces,
1419              KindSignatures, and MonoLocalBinds.
1420
1421       -XTypeFamilyDependencies
1422              Enable injective type families.  Implies TypeFamilies.
1423
1424       -XTypeInType
1425              Deprecated. Enable kind polymorphism and datatype promotion.
1426
1427       -XTypeOperators
1428              Enable type operators.  Implies ExplicitNamespaces.
1429
1430       -XTypeSynonymInstances
1431              Enable  type   synonyms   in   instance   heads.    Implied   by
1432              FlexibleInstances.
1433
1434       -XUnboxedSums
1435              Enable unboxed sums.
1436
1437       -XUnboxedTuples
1438              Enable the use of unboxed tuple syntax.
1439
1440       -XUndecidableInstances
1441              Enable undecidable instances.
1442
1443       -XUndecidableSuperClasses
1444              Allow  all  superclass constraints, including those that may re‐
1445              sult in non-termination of the typechecker.
1446
1447       -XUnicodeSyntax
1448              Enable unicode syntax.
1449
1450       -XUnliftedDatatypes
1451              Enable unlifted data types.
1452
1453       -XUnliftedFFITypes
1454              Enable unlifted FFI types
1455
1456       -XUnliftedNewtypes
1457              Enable unlifted newtypes.
1458
1459       -XUnsafe
1460              Enable Safe Haskell Unsafe mode.
1461
1462       -XViewPatterns
1463              Enable view patterns.
1464
1465   Linking options
1466       -c     Stop after generating object (.o) file
1467
1468       -debug Use the debugging runtime
1469
1470       -dylib-install-name ⟨path⟩
1471              Set the  install  name  (via  -install_name  passed  to  Apple's
1472              linker),  specifying  the full install path of the library file.
1473              Any libraries or executables that link with it later  will  pick
1474              up  that  path  as  their runtime search location for it.  (Dar‐
1475              win/OS X only)
1476
1477       -dynamic
1478              Build dynamically-linked object files and executables
1479
1480       -dynload
1481              Selects one of a number of modes for finding shared libraries at
1482              runtime.
1483
1484       -eventlog
1485              Enable runtime event tracing
1486
1487       -fcompact-unwind
1488              Instruct the linker to produce a __compact_unwind section.
1489
1490       -fkeep-cafs
1491              Do not garbage-collect CAFs (top-level expressions) at runtime
1492
1493       -flink-rts
1494              Link the runtime when generating a shared or static library
1495
1496       -fno-embed-manifest
1497              Do not embed the manifest in the executable (Windows only)
1498
1499       -fno-gen-manifest
1500              Do not generate a manifest file (Windows only)
1501
1502       -fno-shared-implib
1503              Don't generate an import library for a DLL (Windows only)
1504
1505       -framework ⟨name⟩
1506              On  Darwin/OS X/iOS only, link in the framework ⟨name⟩. This op‐
1507              tion corresponds to the -framework option for Apple's Linker.
1508
1509       -framework-path ⟨dir⟩
1510              On Darwin/OS X/iOS only, add ⟨dir⟩ to the  list  of  directories
1511              searched  for  frameworks. This option corresponds to the -F op‐
1512              tion for Apple's Linker.
1513
1514       -fsplit-sections
1515              Split sections for link-time dead-code stripping
1516
1517       -fuse-rpaths
1518              Set the rpath based on -L flags
1519
1520       -fwhole-archive-hs-libs
1521              When  linking  a  binary  executable,  this  inserts  the   flag
1522              -Wl,--whole-archive  before  any -l flags for Haskell libraries,
1523              and -Wl,--no-whole-archive afterwards
1524
1525       -L ⟨dir⟩
1526              Add ⟨dir⟩ to the list of directories searched for libraries
1527
1528       -l ⟨lib⟩
1529              Link in library ⟨lib⟩
1530
1531       -main-is ⟨thing⟩
1532              Set main module and function
1533
1534       -no-hs-main
1535              Don't assume this program contains main
1536
1537       -no-pie
1538              Don't instruct the linker to produce a position-independent exe‐
1539              cutable.
1540
1541       -no-rtsopts-suggestions
1542              Don't    print    RTS    suggestions    about    linking    with
1543              -rtsopts[=⟨none|some|all|ignore|ignoreAll⟩].
1544
1545       -package ⟨name⟩
1546              Expose package ⟨pkg⟩
1547
1548       -pie   Instruct the  linker  to  produce  a  position-independent  exe‐
1549              cutable.
1550
1551       -rdynamic
1552              This  instructs  the  linker  to  add all symbols, not only used
1553              ones, to the dynamic symbol  table.  Currently  Linux  and  Win‐
1554              dows/MinGW32  only.  This is equivalent to using -optl -rdynamic
1555              on Linux, and -optl -export-all-symbols on Windows.
1556
1557       -rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]
1558              Control whether the  RTS  behaviour  can  be  tweaked  via  com‐
1559              mand-line  flags and the GHCRTS environment variable. Using none
1560              means no RTS flags can be given; some means only  a  minimum  of
1561              safe  options can be given (the default); all (or no argument at
1562              all) means that all RTS flags are permitted;  ignore  means  RTS
1563              flags  can  be  given,  but are treated as regular arguments and
1564              passed to the Haskell program as  arguments;  ignoreAll  is  the
1565              same  as  ignore,  but GHCRTS is also ignored. -rtsopts does not
1566              affect -with-rtsopts behavior; flags  passed  via  -with-rtsopts
1567              are used regardless of -rtsopts.
1568
1569       -shared
1570              Generate a shared library (as opposed to an executable)
1571
1572       -single-threaded
1573              Use the single-threaded runtime
1574
1575       -static
1576              Use static Haskell libraries
1577
1578       -staticlib
1579              Generate  a  standalone  static  library  (as opposed to an exe‐
1580              cutable). This is useful when cross compiling. The  library  to‐
1581              gether  with  all its dependencies ends up in in a single static
1582              library that can be linked against.
1583
1584       -threaded
1585              Use the threaded runtime
1586
1587       -with-rtsopts=⟨opts⟩
1588              Set the default RTS options to ⟨opts⟩.
1589
1590   Miscellaneous options
1591       -ddump-mod-cycles
1592              Dump module cycles
1593
1594       -fdefer-out-of-scope-variables
1595              Convert variable out of scope variables  errors  into  warnings.
1596              Implied       by       -fdefer-type-errors.        See      also
1597              -Wdeferred-out-of-scope-variables.
1598
1599       -fdefer-type-errors
1600              Turn type errors into warnings, deferring the error  until  run‐
1601              time.          Implies          -fdefer-typed-holes          and
1602              -fdefer-out-of-scope-variables.             See             also
1603              -Wdeferred-type-errors.
1604
1605       -fdefer-typed-holes
1606              Convert typed hole errors into warnings, deferring the error un‐
1607              til  runtime.   Implied  by   -fdefer-type-errors.    See   also
1608              -Wtyped-holes.
1609
1610       -fexternal-interpreter
1611              Run interpreted code in a separate process
1612
1613       -ffamily-application-cache
1614              Use a cache when reducing type family applications
1615
1616       -fglasgow-exts
1617              Deprecated. Enable most language extensions; see Controlling ex‐
1618              tensions for exactly which ones.
1619
1620       -fno-safe-haskell
1621              Disable Safe Haskell
1622
1623       -ghcversion-file ⟨path to ghcversion.h⟩
1624              (GHC as a C compiler only) Use this ghcversion.h file
1625
1626       -H ⟨size⟩
1627              Set the minimum size of the heap to ⟨size⟩
1628
1629       -hidden-module ⟨module name⟩
1630              A module which should not be visible outside its unit.
1631
1632       -j[⟨n⟩]
1633              When compiling with --make, compile ⟨n⟩ modules in parallel.
1634
1635       -jsem  When compiling with  --make,  coordinate  with  other  processes
1636              through the semaphore ⟨sem⟩ to compile modules in parallel.
1637
1638       -reexported-module ⟨module name⟩
1639              A module which should be reexported from this unit.
1640
1641       -this-package-name ⟨unit-id⟩
1642              The  name of the package which this module would be part of when
1643              installed.
1644
1645       -unit @⟨filename⟩
1646              Specify the options to build a specific unit.
1647
1648       -working-dir ⟨dir⟩
1649              Specify the directory a unit is expected to be compiled in.
1650
1651   Modes of operation
1652       --frontend ⟨module⟩
1653              run GHC with the given frontend plugin; see Frontend plugins for
1654              details.
1655
1656       --help Display help
1657
1658       --info display information about the compiler
1659
1660       --interactive
1661              Interactive mode - normally used by just running ghci; see Using
1662              GHCi for details.
1663
1664       --make Build a multi-module Haskell program, automatically figuring out
1665              dependencies.  Likely  to be much easier, and faster, than using
1666              make; see Using ghc --make for details.
1667
1668       --numeric-version
1669              display GHC version (numeric only)
1670
1671       --print-booter-version
1672              display bootstrap compiler version
1673
1674       --print-build-platform
1675              display platform on which GHC was built
1676
1677       --print-c-compiler-flags
1678              C compiler flags used to build GHC
1679
1680       --print-c-compiler-link-flags
1681              C linker flags used to build GHC
1682
1683       --print-debug-on
1684              print whether GHC was built with -DDEBUG
1685
1686       --print-global-package-db
1687              display GHC's global package database directory
1688
1689       --print-have-interpreter
1690              display whether GHC was built with interactive support
1691
1692       --print-have-native-code-generator
1693              display whether target platform has NCG support
1694
1695       --print-host-platform
1696              display host platform of GHC
1697
1698       --print-ld-flags
1699              display linker flags used to compile GHC
1700
1701       --print-leading-underscore
1702              display use of leading underscores on symbol names
1703
1704       --print-libdir
1705              display GHC library directory
1706
1707       --print-object-splitting-supported
1708              display whether GHC supports object splitting
1709
1710       --print-project-git-commit-id
1711              display Git commit id GHC is built from
1712
1713       --print-project-version
1714              display GHC version
1715
1716       --print-rts-ways
1717              display which way RTS was built
1718
1719       --print-stage
1720              display stage number of GHC
1721
1722       --print-support-smp
1723              display whether GHC was compiled with SMP support
1724
1725       --print-tables-next-to-code
1726              display   whether   GHC   was   compiled    with    --enable-ta‐
1727              bles-next-to-code
1728
1729       --print-target-platform
1730              display target platform of GHC
1731
1732       --print-unregisterised
1733              display whether this GHC was built in unregisterised mode
1734
1735       --run ⟨file⟩
1736              Run a Haskell program.
1737
1738       --show-iface ⟨file⟩
1739              display the contents of an interface file.
1740
1741       --show-options
1742              display the supported command line options
1743
1744       --supported-extensions
1745              display the supported language extensions
1746
1747       --version
1748              display GHC version
1749
1750       -e ⟨expr⟩
1751              Evaluate expr; see Expression evaluation mode for details.
1752
1753       -M     generate  dependency information suitable for use in a Makefile;
1754              see Dependency generation for details.
1755
1756       -shared
1757              Create a shared object.
1758
1759   Individual optimizations
1760       -fasm-shortcutting
1761              Enable shortcutting on assembly. Implied by -O2.
1762
1763       -fbinary-blob-threshold=⟨n⟩
1764              default: 500K. Tweak assembly generator for binary blobs.
1765
1766       -fblock-layout-cfg
1767              Use the new cfg based block layout algorithm. Implied by -O.
1768
1769       -fblock-layout-weightless
1770              Ignore cfg weights for code layout.
1771
1772       -fblock-layout-weights
1773              Sets edge weights used by the new code layout algorithm.
1774
1775       -fcall-arity
1776              Enable call-arity optimisation. Implied by -O.
1777
1778       -fcase-folding
1779              Enable constant folding in case expressions. Implied by -O.
1780
1781       -fcase-merge
1782              Enable case-merging. Implied by -O.
1783
1784       -fcmm-control-flow
1785              Enable control flow optimisation in the Cmm backend. Implied  by
1786              -O.
1787
1788       -fcmm-elim-common-blocks
1789              Enable Cmm common block elimination. Implied by -O.
1790
1791       -fcmm-sink
1792              Enable Cmm sinking. Implied by -O.
1793
1794       -fcmm-static-pred
1795              Enable static control flow prediction. Implied by -O.
1796
1797       -fcore-constant-folding
1798              Enable constant folding in Core. Implied by -O.
1799
1800       -fcpr-anal
1801              Turn on Constructed Product Result analysis. Implied by -O.
1802
1803       -fcross-module-specialise
1804              Turn  on  specialisation  of  overloaded functions imported from
1805              other modules. Implied by -O.
1806
1807       -fcse  Enable common sub-expression elimination. Implied by -O.
1808
1809       -fdicts-cheap
1810              Make dictionary-valued expressions seem cheap to the optimiser.
1811
1812       -fdicts-strict
1813              Make dictionaries strict. Implied by -O2.
1814
1815       -fdmd-tx-dict-sel
1816              (deprecated) Use a special demand transformer for dictionary se‐
1817              lectors.
1818
1819       -fdmd-unbox-width=⟨n⟩
1820              default:  3. Boxity analysis pretends that returned records with
1821              this many fields can be unboxed.
1822
1823       -fdo-eta-reduction
1824              Enable eta-reduction. Always enabled by default.
1825
1826       -fdo-lambda-eta-expansion
1827              Enable lambda eta-expansion. Always enabled by default.
1828
1829       -feager-blackholing
1830              Turn on eager blackholing
1831
1832       -fenable-rewrite-rules
1833              Switch on all rewrite rules (including rules generated by  auto‐
1834              matic specialisation of overloaded functions). Implied by -O.
1835
1836       -fexcess-precision
1837              Enable excess intermediate precision
1838
1839       -fexitification
1840              Enables exitification optimisation. Implied by -O.
1841
1842       -fexpose-all-unfoldings
1843              Expose  all  unfoldings,  even for very large or recursive func‐
1844              tions.
1845
1846       -ffloat-in
1847              Turn on the float-in transformation. Implied by -O.
1848
1849       -ffull-laziness
1850              Turn on full laziness (floating bindings outwards).  Implied  by
1851              -O.
1852
1853       -ffun-to-thunk
1854              (deprecated) superseded by -ffull-laziness.
1855
1856       -fignore-asserts
1857              Ignore assertions in the source. Implied by -O.
1858
1859       -fignore-interface-pragmas
1860              Ignore pragmas in interface files. Implied by -O0 only.
1861
1862       -finline-generics
1863              Annotate  methods of derived Generic and Generic1 instances with
1864              INLINE[1] pragmas based on heuristics. Implied by -O.
1865
1866       -finline-generics-aggressively
1867              Annotate methods of all derived Generic and  Generic1  instances
1868              with INLINE[1] pragmas.
1869
1870       -flate-dmd-anal
1871              Run  demand  analysis  again,  at  the end of the simplification
1872              pipeline
1873
1874       -flate-specialise
1875              Run a late specialisation pass
1876
1877       -fliberate-case
1878              Turn on the liberate-case transformation. Implied by -O2.
1879
1880       -fliberate-case-threshold=⟨n⟩
1881              default: 2000. Set the  size  threshold  for  the  liberate-case
1882              transformation to ⟨n⟩
1883
1884       -fllvm-pass-vectors-in-regs
1885              (deprecated) Does nothing
1886
1887       -flocal-float-out
1888              Enable local floating definitions out of let-binds.
1889
1890       -flocal-float-out-top-level
1891              Enable local floating to float top-level bindings
1892
1893       -floopification
1894              Turn saturated self-recursive tail-calls into local jumps in the
1895              generated assembly. Implied by -O.
1896
1897       -fmax-inline-alloc-size=⟨n⟩
1898              default: 128. Set the maximum size of inline  array  allocations
1899              to ⟨n⟩ bytes (default: 128).
1900
1901       -fmax-inline-memcpy-insns=⟨n⟩
1902              default:  32. Inline memcpy calls if they would generate no more
1903              than ⟨n⟩ pseudo instructions.
1904
1905       -fmax-inline-memset-insns=⟨n⟩
1906              default: 32. Inline memset calls if they would generate no  more
1907              than ⟨n⟩ pseudo instructions
1908
1909       -fmax-simplifier-iterations=⟨n⟩
1910              default: 4. Set the max iterations for the simplifier.
1911
1912       -fmax-uncovered-patterns=⟨n⟩
1913              default:  4.  Set  the  maximum number of patterns to display in
1914              warnings about non-exhaustive ones.
1915
1916       -fmax-worker-args=⟨n⟩
1917              default: 10. Maximum number of value arguments for a worker.
1918
1919       -fno-opt-coercion
1920              Turn off the coercion optimiser
1921
1922       -fno-pre-inlining
1923              Turn off pre-inlining
1924
1925       -fno-state-hack
1926              Turn off the state hackwhereby  any  lambda  with  a  real-world
1927              state  token as argument is considered to be single-entry. Hence
1928              OK to inline things inside it.
1929
1930       -fomit-interface-pragmas
1931              Don't generate interface pragmas. Implied by -O0 only.
1932
1933       -fomit-yields
1934              Omit heap checks when no allocation is being performed.
1935
1936       -foptimal-applicative-do
1937              Use a slower but better algorithm for ApplicativeDo
1938
1939       -fpedantic-bottoms
1940              Make GHC be more precise about its treatment of bottom (but  see
1941              also  -fno-state-hack).  In  particular, GHC will not eta-expand
1942              through a case expression.
1943
1944       -fpolymorphic-specialisation
1945              Allow specialisation to abstract over free type variables
1946
1947       -fregs-graph
1948              Use the graph colouring register allocator for register  alloca‐
1949              tion in the native code generator.
1950
1951       -fregs-iterative
1952              Use  the iterative coalescing graph colouring register allocator
1953              in the native code generator.
1954
1955       -fsimpl-tick-factor=⟨n⟩
1956              default: 100. Set the percentage factor for simplifier ticks.
1957
1958       -fsimplifier-phases=⟨n⟩
1959              default: 2. Set the number of phases for  the  simplifier.   Ig‐
1960              nored with -O0.
1961
1962       -fsolve-constant-dicts
1963              When solving constraints, try to eagerly solve super classes us‐
1964              ing available dictionaries. Implied by -O.
1965
1966       -fspec-constr
1967              Turn on the SpecConstr transformation. Implied by -O2.
1968
1969       -fspec-constr-count=⟨n⟩
1970              default: 3.* Set to ⟨n⟩ the maximum  number  of  specialisations
1971              that  will  be  created  for  any one function by the SpecConstr
1972              transformation.
1973
1974       -fspec-constr-keen
1975              Specialize a call with an explicit constructor argument, even if
1976              the argument is not scrutinised in the body of the function
1977
1978       -fspec-constr-threshold=⟨n⟩
1979              default:  2000. Set the size threshold for the SpecConstr trans‐
1980              formation to ⟨n⟩.
1981
1982       -fspecialise
1983              Turn on specialisation of overloaded functions. Implied by -O.
1984
1985       -fspecialise-aggressively
1986              Turn on specialisation of  overloaded  functions  regardless  of
1987              size, if unfolding is available
1988
1989       -fspecialise-incoherents
1990              Enable specialisation on incoherent instances
1991
1992       -fstatic-argument-transformation
1993              Turn on the static argument transformation.
1994
1995       -fstg-cse
1996              Enable common sub-expression elimination on the STG intermediate
1997              language. Implied by -O.
1998
1999       -fstg-lift-lams
2000              Enable late lambda lifting on the STG intermediate language. Im‐
2001              plied by -O2.
2002
2003       -fstg-lift-lams-known
2004              Allow  turning  known  into  unknown calls while performing late
2005              lambda lifting.
2006
2007       -fstg-lift-lams-non-rec-args
2008              Create top-level non-recursive functions with at most <n> param‐
2009              eters while performing late lambda lifting.
2010
2011       -fstg-lift-lams-rec-args
2012              Create top-level recursive functions with at most <n> parameters
2013              while performing late lambda lifting.
2014
2015       -fstrictness
2016              Turn   on   demand   analysis.    Implied   by    -O.    Implies
2017              -fworker-wrapper
2018
2019       -fstrictness-before=⟨n⟩
2020              Run an additional demand analysis before simplifier phase ⟨n⟩
2021
2022       -funbox-small-strict-fields
2023              Flatten strict constructor fields with a pointer-sized represen‐
2024              tation. Implied by -O.
2025
2026       -funbox-strict-fields
2027              Flatten strict constructor fields
2028
2029       -funfolding-case-scaling=⟨n⟩
2030              default: 30. Apply a penalty of (inlining_cost * 1/n)  for  each
2031              level of case nesting.
2032
2033       -funfolding-case-threshold=⟨n⟩
2034              default: 2. Reduce inlining for cases nested deeper than n.
2035
2036       -funfolding-creation-threshold=⟨n⟩
2037              default: 750. Tweak unfolding settings.
2038
2039       -funfolding-dict-discount=⟨n⟩
2040              default: 30. Tweak unfolding settings.
2041
2042       -funfolding-fun-discount=⟨n⟩
2043              default: 60. Tweak unfolding settings.
2044
2045       -funfolding-keeness-factor=⟨n⟩
2046              This has been deprecated in GHC 9.0.1.
2047
2048       -funfolding-use-threshold=⟨n⟩
2049              default: 80. Tweak unfolding settings.
2050
2051       -fworker-wrapper
2052              Enable  the  worker/wrapper transformation. Implied by -O and by
2053              -fstrictness.
2054
2055       -fworker-wrapper-cbv
2056              Enable w/w splits for wrappers whos sole purpose  is  evaluating
2057              arguments.
2058
2059   Optimization levels
2060       -O     Enable level 1 optimisations
2061
2062       -O0    Disable optimisations (default)
2063
2064       -O2    Enable level 2 optimisations
2065
2066       -O⟨n⟩  Any -On where n > 2 is the same as -O2.
2067
2068   Package options
2069       -clear-package-db
2070              Clear the package db stack.
2071
2072       -distrust ⟨pkg⟩
2073              Expose  package  ⟨pkg⟩  and  set  it  to be distrusted. See Safe
2074              Haskell.
2075
2076       -distrust-all-packages
2077              Distrust all packages by default. See Safe Haskell.
2078
2079       -fpackage-trust
2080              Enable Safe Haskell trusted package requirement for  trustworthy
2081              modules.
2082
2083       -global-package-db
2084              Add the global package db to the stack.
2085
2086       -hide-all-packages
2087              Hide all packages by default
2088
2089       -hide-package ⟨pkg⟩
2090              Hide package ⟨pkg⟩
2091
2092       -ignore-package ⟨pkg⟩
2093              Ignore package ⟨pkg⟩
2094
2095       -no-auto-link-packages
2096              Don't automatically link in the base and rts packages.
2097
2098       -no-global-package-db
2099              Remove the global package db from the stack.
2100
2101       -no-user-package-db
2102              Remove the user's package db from the stack.
2103
2104       -package ⟨pkg⟩
2105              Expose package ⟨pkg⟩
2106
2107       -package-db ⟨file⟩
2108              Add ⟨file⟩ to the package db stack.
2109
2110       -package-env ⟨file⟩|⟨name⟩
2111              Use the specified package environment.
2112
2113       -package-id ⟨unit-id⟩
2114              Expose package by id ⟨unit-id⟩
2115
2116       -this-unit-id ⟨unit-id⟩
2117              Compile to be part of unit (i.e. package) ⟨unit-id⟩
2118
2119       -trust ⟨pkg⟩
2120              Expose package ⟨pkg⟩ and set it to be trusted. See Safe Haskell.
2121
2122       -user-package-db
2123              Add the user's package db to the stack.
2124
2125   Phases of compilation
2126       --merge-objs
2127              Merge a set of objects into a GHCi library.
2128
2129       -C     Stop after generating C (.hc file)
2130
2131       -c     Stop after generating object (.o) file
2132
2133       -E     Stop after preprocessing (.hspp file)
2134
2135       -F     Enable the use of a pre-processor (set with -pgmF ⟨cmd⟩)
2136
2137       -S     Stop after generating assembly (.s file)
2138
2139       -x ⟨suffix⟩
2140              Override default behaviour for source files
2141
2142   Overriding external programs
2143       -pgma ⟨cmd⟩
2144              Use ⟨cmd⟩ as the assembler
2145
2146       -pgmc ⟨cmd⟩
2147              Use ⟨cmd⟩ as the C compiler
2148
2149       -pgmcxx ⟨cmd⟩
2150              Use ⟨cmd⟩ as the C++ compiler
2151
2152       -pgmdll ⟨cmd⟩
2153              Use ⟨cmd⟩ as the DLL generator
2154
2155       -pgmF ⟨cmd⟩
2156              Use ⟨cmd⟩ as the pre-processor (with -F only)
2157
2158       -pgmi ⟨cmd⟩
2159              Use ⟨cmd⟩ as the external interpreter command.
2160
2161       -pgminstall_name_tool ⟨cmd⟩
2162              Use ⟨cmd⟩ as the program to inject runpath into mach-o dylibs on
2163              macOS
2164
2165       -pgmL ⟨cmd⟩
2166              Use ⟨cmd⟩ as the literate pre-processor
2167
2168       -pgml ⟨cmd⟩
2169              Use ⟨cmd⟩ as the linker
2170
2171       -pgmlc ⟨cmd⟩
2172              Use ⟨cmd⟩ as the LLVM compiler
2173
2174       -pgmlm ⟨cmd⟩
2175              Use ⟨cmd⟩ as the linker when merging object files
2176
2177       -pgmlo ⟨cmd⟩
2178              Use ⟨cmd⟩ as the LLVM optimiser
2179
2180       -pgmotool ⟨cmd⟩
2181              Use ⟨cmd⟩ as the program to inspect mach-o dylibs on macOS
2182
2183       -pgmP ⟨cmd⟩
2184              Use ⟨cmd⟩ as the C pre-processor (with -cpp only)
2185
2186       -pgms ⟨cmd⟩
2187              Use ⟨cmd⟩ as the splitter
2188
2189       -pgmwindres ⟨cmd⟩
2190              Use ⟨cmd⟩ as the program for embedding manifests on Windows.
2191
2192   Phase-specific options
2193       -opta ⟨option⟩
2194              pass ⟨option⟩ to the assembler
2195
2196       -optc ⟨option⟩
2197              pass ⟨option⟩ to the C compiler
2198
2199       -optcxx ⟨option⟩
2200              pass ⟨option⟩ to the C++ compiler
2201
2202       -optF ⟨option⟩
2203              pass ⟨option⟩ to the custom pre-processor
2204
2205       -opti ⟨option⟩
2206              pass ⟨option⟩ to the interpreter sub-process.
2207
2208       -optL ⟨option⟩
2209              pass ⟨option⟩ to the literate pre-processor
2210
2211       -optl ⟨option⟩
2212              pass ⟨option⟩ to the linker
2213
2214       -optlc ⟨option⟩
2215              pass ⟨option⟩ to the LLVM compiler
2216
2217       -optlm ⟨option⟩
2218              pass ⟨option⟩ to the linker when merging object files.
2219
2220       -optlo ⟨option⟩
2221              pass ⟨option⟩ to the LLVM optimiser
2222
2223       -optP ⟨option⟩
2224              pass ⟨option⟩ to cpp (with -cpp only)
2225
2226       -optwindres ⟨option⟩
2227              pass ⟨option⟩ to windres.
2228
2229       -pgmc-supports-no-pie
2230              (deprecated) Indicate that the linker supports -no-pie
2231
2232       -pgml-supports-no-pie
2233              Indicate that the linker supports -no-pie
2234
2235   Platform-specific options
2236       -mavx  (x86 only) Enable support for AVX SIMD extensions
2237
2238       -mavx2 (x86 only) Enable support for AVX2 SIMD extensions
2239
2240       -mavx512cd
2241              (x86 only) Enable support for AVX512-CD SIMD extensions
2242
2243       -mavx512er
2244              (x86 only) Enable support for AVX512-ER SIMD extensions
2245
2246       -mavx512f
2247              (x86 only) Enable support for AVX512-F SIMD extensions
2248
2249       -mavx512pf
2250              (x86 only) Enable support for AVX512-PF SIMD extensions
2251
2252       -mbmi  (x86 only) Use BMI1 for bit manipulation operations
2253
2254       -mbmi2 (x86 only) Use BMI2 for bit manipulation operations
2255
2256       -mfma  Use  native  FMA  instructions  for  fused  multiply-add  float‐
2257              ing-point operations
2258
2259       -msse  (x86 only) Use SSE for floating-point operations
2260
2261       -msse2 (x86 only) Use SSE2 for floating-point operations
2262
2263       -msse3 (x86 only) Use SSE3 for floating-point operations
2264
2265       -msse4 (x86 only) Use SSE4 for floating-point operations
2266
2267       -msse4.2
2268              (x86 only) Use SSE4.2 for floating-point operations
2269
2270   Compiler plugins
2271       -fclear-plugins
2272              Clear the list of active plugins
2273
2274       -fplugin-library=⟨file-path⟩;⟨unit-id⟩;⟨module⟩;⟨args⟩
2275              Load a pre-compiled static plugin from an external library
2276
2277       -fplugin-opt=⟨module⟩:⟨args⟩
2278              Give arguments to a plugin module; module must be specified with
2279              -fplugin=⟨module⟩
2280
2281       -fplugin-trustworthy
2282              Trust the used plugins and no longer mark the compiled module as
2283              unsafe
2284
2285       -fplugin=⟨module⟩
2286              Load a plugin exported by a given module
2287
2288       -hide-all-plugin-packages
2289              Hide all packages for plugins by default
2290
2291       -plugin-package ⟨pkg⟩
2292              Expose ⟨pkg⟩ for plugins
2293
2294       -plugin-package-id ⟨pkg-id⟩
2295              Expose ⟨pkg-id⟩ for plugins
2296
2297   Profiling
2298       -auto  (deprecated) Alias for -fprof-auto-exported
2299
2300       -auto-all
2301              (deprecated) Alias for -fprof-auto
2302
2303       -caf-all
2304              (deprecated) Alias for -fprof-cafs
2305
2306       -fno-prof-count-entries
2307              Do not collect entry counts
2308
2309       -fprof-auto
2310              Auto-add SCC\ s to all bindings not marked INLINE
2311
2312       -fprof-auto-calls
2313              Auto-add SCC\ s to all call sites
2314
2315       -fprof-auto-exported
2316              Auto-add SCC\ s to all exported bindings not marked INLINE
2317
2318       -fprof-auto-top
2319              Auto-add SCC\ s to all top-level bindings not marked INLINE
2320
2321       -fprof-cafs
2322              Auto-add SCC\ s to all CAFs
2323
2324       -fprof-callers=⟨name⟩
2325              Auto-add SCC\ s to all call-sites of the named function.
2326
2327       -fprof-late
2328              Auto-add  SCC\  s to all top level bindings after the core pipe‐
2329              line has run.
2330
2331       -fprof-late-inline
2332              Auto-add SCC\ s to all top level bindings  after  the  optimizer
2333              has run and retain them when inlining.
2334
2335       -fprof-manual
2336              Process manual SCC annotations.
2337
2338       -no-auto
2339              (deprecated) Alias for -fno-prof-auto
2340
2341       -no-auto-all
2342              (deprecated) Alias for -fno-prof-auto
2343
2344       -no-caf-all
2345              (deprecated) Alias for -fno-prof-cafs
2346
2347       -prof  Turn on profiling
2348
2349       -ticky Turn on ticky-ticky profiling
2350
2351       -ticky-allocd
2352              Track the number of times each closure type is allocated.
2353
2354       -ticky-ap-thunk
2355              Don't use standard AP thunks on order to get more reliable entry
2356              counters.
2357
2358       -ticky-dyn-thunk
2359              Track allocations of dynamic thunks
2360
2361       -ticky-LNE
2362              Treat join point binders similar to thunks/functions.
2363
2364       -ticky-tag-checks
2365              Emit dummy ticky  counters  to  record  how  many  tag-inference
2366              checks tag inference avoided.
2367
2368   Program coverage
2369       -fhpc  Turn on Haskell program coverage instrumentation
2370
2371       -hpcdir⟨dir⟩
2372              Set the directory where GHC places .mix files.
2373
2374   Recompilation checking
2375       -exclude-module=⟨file⟩
2376              Regard  ⟨file⟩  as "stable"; i.e., exclude it from having depen‐
2377              dencies on it.
2378
2379       -fforce-recomp
2380              Turn off recompilation checking. This is implied by any -ddump-X
2381              option when compiling a single file (i.e. when using -c).
2382
2383       -fignore-hpc-changes
2384              Do  not  recompile  modules  just to match changes to HPC flags.
2385              This is especially useful for avoiding recompilation when  using
2386              GHCi, and is enabled by default for GHCi.
2387
2388       -fignore-optim-changes
2389              Do  not  recompile modules just to match changes to optimisation
2390              flags. This is especially useful for avoiding recompilation when
2391              using GHCi, and is enabled by default for GHCi.
2392
2393       -include-cpp-deps
2394              Include preprocessor dependencies
2395
2396       -include-pkg-deps
2397              Regard modules imported from packages as unstable
2398
2399   Redirecting output
2400       -dep-makefile ⟨file⟩
2401              Use ⟨file⟩ as the makefile
2402
2403       -dep-suffix ⟨suffix⟩
2404              Make   dependencies   that   declare   that  files  with  suffix
2405              .⟨suf⟩⟨osuf⟩ depend on interface files with suffix .⟨suf⟩hi
2406
2407       -dumpdir ⟨dir⟩
2408              redirect dump files
2409
2410       -dynhisuf ⟨suffix⟩
2411              set the suffix to use for dynamic interface files
2412
2413       -dyno ⟨file⟩
2414              set dynamic output filename
2415
2416       -dynohi ⟨file⟩
2417              set the filename in which to put the dynamic interface
2418
2419       -dynosuf ⟨suffix⟩
2420              set the dynamic output file suffix
2421
2422       -hcsuf ⟨suffix⟩
2423              set the suffix to use for intermediate C files
2424
2425       -hidir ⟨dir⟩
2426              set directory for interface files
2427
2428       -hiedir ⟨dir⟩
2429              set directory for extended interface files
2430
2431       -hiesuf ⟨suffix⟩
2432              set the suffix to use for extended interface files
2433
2434       -hisuf ⟨suffix⟩
2435              set the suffix to use for interface files
2436
2437       -o ⟨file⟩
2438              set output filename
2439
2440       -odir ⟨dir⟩
2441              set directory for object files
2442
2443       -ohi ⟨file⟩
2444              set the filename in which to put the interface
2445
2446       -osuf ⟨suffix⟩
2447              set the output file suffix
2448
2449       -outputdir ⟨dir⟩
2450              set output directory
2451
2452       -stubdir ⟨dir⟩
2453              redirect FFI stub files
2454
2455   Temporary files
2456       -tmpdir ⟨dir⟩
2457              set the directory for temporary files
2458
2459   Verbosity options
2460       -fabstract-refinement-hole-fits
2461              default: off. Toggles whether refinements where one or  more  of
2462              the holes are abstract are reported.
2463
2464       -fdefer-diagnostics
2465              Defer and group diagnostic messages by severity
2466
2467       -fdiagnostics-color=⟨always|auto|never⟩
2468              Use colors in error messages
2469
2470       -fdiagnostics-show-caret
2471              Whether to show snippets of original source code
2472
2473       -ferror-spans
2474              Output full span in error messages
2475
2476       -fhide-source-paths
2477              hide module source and object paths
2478
2479       -fkeep-going
2480              Continue compilation as far as possible on errors
2481
2482       -fmax-refinement-hole-fits=⟨n⟩
2483              default:  6.  Set the maximum number of refinement hole fits for
2484              typed holes to display in type error messages.
2485
2486       -fmax-relevant-binds=⟨n⟩
2487              default: 6. Set the maximum number of  bindings  to  display  in
2488              type error messages.
2489
2490       -fmax-valid-hole-fits=⟨n⟩
2491              default:  6. Set the maximum number of valid hole fits for typed
2492              holes to display in type error messages.
2493
2494       -fno-show-valid-hole-fits
2495              Disables showing a list of valid hole fits for  typed  holes  in
2496              type error messages.
2497
2498       -fno-sort-valid-hole-fits
2499              Disables  the  sorting  of the list of valid hole fits for typed
2500              holes in type error messages.
2501
2502       -fprint-axiom-incomps
2503              Display equation incompatibilities in closed type families
2504
2505       -fprint-equality-relations
2506              Distinguish between equality relations when printing
2507
2508       -fprint-expanded-synonyms
2509              In type errors, also print type-synonym-expanded types.
2510
2511       -fprint-explicit-coercions
2512              Print coercions in types
2513
2514       -fprint-explicit-foralls
2515              Print  explicit  forall  quantification  in  types.   See   also
2516              ExplicitForAll
2517
2518       -fprint-explicit-kinds
2519              Print  explicit  kind  foralls and kind arguments in types.  See
2520              also KindSignatures
2521
2522       -fprint-explicit-runtime-reps
2523              Print RuntimeRep and Levity variables in types  which  are  run‐
2524              time-representation polymorphic.
2525
2526       -fprint-potential-instances
2527              display all available instances in type error messages
2528
2529       -fprint-redundant-promotion-ticks
2530              Print redundant DataKinds promotion ticks
2531
2532       -fprint-typechecker-elaboration
2533              Print extra information from typechecker.
2534
2535       -fprint-unicode-syntax
2536              Use  unicode  syntax when printing expressions, types and kinds.
2537              See also UnicodeSyntax
2538
2539       -frefinement-level-hole-fits=⟨n⟩
2540              default: off. Sets the level of  refinement  of  the  refinement
2541              hole  fits,  where level n means that hole fits of up to n holes
2542              will be considered.
2543
2544       -freverse-errors
2545              Output errors in reverse order
2546
2547       -fshow-docs-of-hole-fits
2548              Toggles whether to show the documentation of the valid hole fits
2549              in the output.
2550
2551       -fshow-error-context
2552              Whether to show textual information about error context
2553
2554       -fshow-hole-constraints
2555              Show constraints when reporting typed holes.
2556
2557       -fshow-hole-matches-of-hole-fits
2558              Toggles  whether to show the type of the additional holes in re‐
2559              finement hole fits.
2560
2561       -fshow-provenance-of-hole-fits
2562              Toggles whether to show the provenance of the valid hole fits in
2563              the output.
2564
2565       -fshow-type-app-of-hole-fits
2566              Toggles  whether  to show the type application of the valid hole
2567              fits in the output.
2568
2569       -fshow-type-app-vars-of-hole-fits
2570              Toggles whether to show what type each quantified variable takes
2571              in a valid hole fit.
2572
2573       -fshow-type-of-hole-fits
2574              Toggles  whether  to show the type of the valid hole fits in the
2575              output.
2576
2577       -fsort-by-size-hole-fits
2578              Sort valid hole fits by size.
2579
2580       -fsort-by-subsumption-hole-fits
2581              Sort valid hole fits by subsumption.
2582
2583       -funclutter-valid-hole-fits
2584              Unclutter the list of valid hole fits by not showing  provenance
2585              nor type applications of suggestions.
2586
2587       -Rghc-timing
2588              Summarise timing stats for GHC (same as +RTS -tstderr).
2589
2590       -v     verbose mode (equivalent to -v3)
2591
2592       -v⟨n⟩  set verbosity level
2593
2594   Warnings
2595       -fenable-th-splice-warnings
2596              Generate warnings for Template Haskell splices
2597
2598       -fhelpful-errors
2599              Make suggestions for mis-spelled names.
2600
2601       -fmax-pmcheck-models=⟨n⟩
2602              soft  limit  on  the number of parallel models the pattern match
2603              checker should check a pattern match clause against
2604
2605       -fshow-warning-groups
2606              show which group an emitted warning belongs to.
2607
2608       -fvia-C
2609              use the C code generator
2610
2611       -W     enable normal warnings
2612
2613       -w     disable all warnings
2614
2615       -Wall  enable  almost  all  warnings  (details  in  Warnings  and  san‐
2616              ity-checking)
2617
2618       -Wall-missed-specialisations
2619              warn when specialisation of any overloaded function fails.
2620
2621       -Wall-missed-specializations
2622              alias for -Wall-missed-specialisations
2623
2624       -Wambiguous-fields
2625              warn about ambiguous field selectors or updates
2626
2627       -Wauto-orphans
2628              (deprecated) Does nothing
2629
2630       -Wcompat
2631              enable  future  compatibility  warnings (details in Warnings and
2632              sanity-checking)
2633
2634       -Wcompat-unqualified-imports
2635              Report unqualified imports of core libraries which are  expected
2636              to cause compatibility problems in future releases.
2637
2638       -Wcpp-undef
2639              warn on uses of the #if directive on undefined identifiers
2640
2641       -Wdefault
2642              enable default flags
2643
2644       -Wdeferred-out-of-scope-variables
2645              Report  warnings  when variable out-of-scope errors are deferred
2646              until runtime.  See -fdefer-out-of-scope-variables.
2647
2648       -Wdeferred-type-errors
2649              Report warnings when deferred type errors are enabled. This  op‐
2650              tion is enabled by default. See -fdefer-type-errors.
2651
2652       -Wdeprecated-flags
2653              warn about uses of commandline flags that are deprecated
2654
2655       -Wdeprecations
2656              warn  about uses of functions & types that have DEPRECATED prag‐
2657              mas, or WARNING pragmas with the deprecated category.
2658
2659       -Wderiving-defaults
2660              warn about default deriving when using both  DeriveAnyClass  and
2661              GeneralizedNewtypeDeriving
2662
2663       -Wderiving-typeable
2664              warn when Typeable is derived
2665
2666       -Wdodgy-exports
2667              warn about dodgy exports
2668
2669       -Wdodgy-foreign-imports
2670              warn about dodgy foreign imports
2671
2672       -Wdodgy-imports
2673              warn about dodgy imports
2674
2675       -Wduplicate-constraints
2676              warn when a constraint appears duplicated in a type signature
2677
2678       -Wduplicate-exports
2679              warn when an entity is exported multiple times
2680
2681       -Wempty-enumerations
2682              warn about enumerations that are empty
2683
2684       -Werror
2685              make warnings fatal
2686
2687       -Weverything
2688              enable all warnings supported by GHC
2689
2690       -Wextended-warnings
2691              warn about uses of functions & types that have WARNING or DEPRE‐
2692              CATED pragmas, across all categories
2693
2694       -Wextra
2695              alias for -W
2696
2697       -Wforall-identifier
2698              warn when forall is used as an identifier (at definition sites)
2699
2700       -Wgadt-mono-local-binds
2701              warn when pattern matching on a GADT without MonoLocalBinds
2702
2703       -Whi-shadowing
2704              (deprecated) warn when a .hi file in the current directory shad‐
2705              ows a library
2706
2707       -Widentities
2708              warn about uses of Prelude numeric conversions that are probably
2709              the identity (and hence could be omitted)
2710
2711       -Wimplicit-kind-vars
2712              (deprecated) warn when kind variables are implicitly  quantified
2713              over.
2714
2715       -Wimplicit-lift
2716              warn about implicit lift in Template Haskell quotes
2717
2718       -Wimplicit-prelude
2719              warn when the Prelude is implicitly imported
2720
2721       -Wimplicit-rhs-quantification
2722              warn  when  type  variables on the RHS of a type synonym are im‐
2723              plicitly quantified
2724
2725       -Winaccessible-code
2726              warn about inaccessible code
2727
2728       -Wincomplete-export-warnings
2729              warn when some but not all of exports  for  a  name  are  warned
2730              about
2731
2732       -Wincomplete-patterns
2733              warn when a pattern match could fail
2734
2735       -Wincomplete-record-updates
2736              warn when a record update could fail
2737
2738       -Wincomplete-uni-patterns
2739              warn  when a pattern match in a lambda expression, pattern bind‐
2740              ing or a lazy pattern could fail
2741
2742       -Winconsistent-flags
2743              warn when command line options are inconsistent in some way.
2744
2745       -Winconsistent-flags
2746              warn when command line options are inconsistent in some way.
2747
2748       -Winferred-safe-imports
2749              warn when an explicitly Safe Haskell module imports  a  Safe-In‐
2750              ferred one
2751
2752       -Winline-rule-shadowing
2753              Warn  if  a rewrite RULE might fail to fire because the function
2754              might be inlined before the rule has a chance to fire.  See  How
2755              rules interact with INLINE/NOINLINE pragmas.
2756
2757       -Winvalid-haddock
2758              warn when a Haddock comment occurs in an invalid position
2759
2760       -Wloopy-superclass-solve
2761              warn  when creating potentially-loopy superclass constraint evi‐
2762              dence
2763
2764       -Wmisplaced-pragmas
2765              warn about uses of file header pragmas in the module body
2766
2767       -Wmissed-extra-shared-lib
2768              Warn when GHCi can't load a shared lib.
2769
2770       -Wmissed-specialisations
2771              warn when specialisation of  an  imported,  overloaded  function
2772              fails.
2773
2774       -Wmissed-specializations
2775              alias for -Wmissed-specialisations
2776
2777       -Wmissing-deriving-strategies
2778              warn when a deriving clause is missing a deriving strategy
2779
2780       -Wmissing-export-lists
2781              warn  when a module declaration does not explicitly list all ex‐
2782              ports
2783
2784       -Wmissing-exported-pattern-synonym-signatures
2785              warn about pattern synonyms without signatures, only if they are
2786              exported
2787
2788       -Wmissing-exported-signatures
2789              warn  about top-level functions without signatures, only if they
2790              are exported
2791
2792       -Wmissing-exported-sigs
2793              (deprecated) warn about top-level functions without  signatures,
2794              only  if they are exported. takes precedence over -Wmissing-sig‐
2795              natures
2796
2797       -Wmissing-fields
2798              warn when fields of a record are uninitialised
2799
2800       -Wmissing-home-modules
2801              warn when encountering a home module imported, but not listed on
2802              the  command  line. Useful for cabal to ensure GHC won't pick up
2803              modules,  not  listed  neither  in   exposed-modules,   nor   in
2804              other-modules.
2805
2806       -Wmissing-import-lists
2807              warn when an import declaration does not explicitly list all the
2808              names brought into scope
2809
2810       -Wmissing-kind-signatures
2811              warn when type declarations don't have kind signatures nor CUSKs
2812
2813       -Wmissing-local-signatures
2814              warn about polymorphic local bindings without signatures
2815
2816       -Wmissing-local-sigs
2817              (deprecated) warn about polymorphic local bindings without  sig‐
2818              natures
2819
2820       -Wmissing-methods
2821              warn when class methods are undefined
2822
2823       -Wmissing-monadfail-instances
2824              (deprecated)  Warn when a failable pattern is used in a do-block
2825              that does not have a MonadFail instance.
2826
2827       -Wmissing-pattern-synonym-signatures
2828              warn when pattern synonyms do not have type signatures
2829
2830       -Wmissing-poly-kind-signatures
2831              warn when inferred polykinded type or  class  declaration  don't
2832              have kind signatures nor CUSKs
2833
2834       -Wmissing-role-annotations
2835              warn when type declarations don't have role annotations
2836
2837       -Wmissing-safe-haskell-mode
2838              warn when the Safe Haskell mode is not explicitly specified.
2839
2840       -Wmissing-signatures
2841              warn about top-level functions without signatures
2842
2843       -Wmissing-space-after-bang
2844              (deprecated) Does nothing
2845
2846       -Wmonomorphism-restriction
2847              warn when the Monomorphism Restriction is applied
2848
2849       -Wname-shadowing
2850              warn when names are shadowed
2851
2852       -Wnoncanonical-monad-instances
2853              warn when Applicative or Monad instances have noncanonical defi‐
2854              nitions of return, pure, (>>), or (*>).  See flag description in
2855              Warnings and sanity-checking for more details.
2856
2857       -Wnoncanonical-monadfail-instances
2858              (deprecated)  warn  when  Monad or MonadFail instances have non‐
2859              canonical definitions of fail.
2860
2861       -Wnoncanonical-monoid-instances
2862              warn when Semigroup or Monoid instances have noncanonical  defi‐
2863              nitions  of  (<>)  or mappend.  See flag description in Warnings
2864              and sanity-checking for more details.
2865
2866       -Wnot  (deprecated) Alias for -w
2867
2868       -Woperator-whitespace
2869              warn on prefix, suffix, and tight infix uses of infix operators
2870
2871       -Woperator-whitespace-ext-conflict
2872              warn on uses of infix operators that would be parsed differently
2873              were a particular GHC extension enabled
2874
2875       -Worphans
2876              warn  when  the  module contains orphan instance declarations or
2877              rewrite rules
2878
2879       -Woverflowed-literals
2880              warn about literals that will overflow their type
2881
2882       -Woverlapping-patterns
2883              warn about overlapping patterns
2884
2885       -Wpartial-fields
2886              warn when defining a partial record field.
2887
2888       -Wpartial-type-signatures
2889              warn   about   holes   in   partial   type    signatures    when
2890              PartialTypeSignatures    is   enabled.   Not   applicable   when
2891              PartialTypeSignatures is not enabled, in which case  errors  are
2892              generated for such holes.
2893
2894       -Wprepositive-qualified-module
2895              Report imports with a leading/prepositive "qualified"
2896
2897       -Wredundant-bang-patterns
2898              Warn about redundant bang patterns.
2899
2900       -Wredundant-constraints
2901              Have  the compiler warn about redundant constraints in type sig‐
2902              natures.
2903
2904       -Wredundant-record-wildcards
2905              Warn about record wildcard matches when the  wildcard  binds  no
2906              patterns.
2907
2908       -Wredundant-strictness-flags
2909              Warn about redundant strictness flags.
2910
2911       -Wsafe warn if the module being compiled is regarded to be safe.
2912
2913       -Wsemigroup
2914              warn when a Monoid is not Semigroup, and on non- Semigroup defi‐
2915              nitions of (<>)?
2916
2917       -Wsimplifiable-class-constraints
2918              Warn about class constraints in a type  signature  that  can  be
2919              simplified using a top-level instance declaration.
2920
2921       -Wstar-binder
2922              warn about binding the (*) type operator despite StarIsType
2923
2924       -Wstar-is-type
2925              warn when * is used to mean Data.Kind.Type
2926
2927       -Wtabs warn if there are tabs in the source file
2928
2929       -Wterm-variable-capture
2930              warn  when  an  implicitly  quantified  type variable captures a
2931              term's name
2932
2933       -Wtrustworthy-safe
2934              warn if the module being compiled is marked as  Trustworthy  but
2935              it could instead be marked as Safe, a more informative bound.
2936
2937       -Wtype-defaults
2938              warn when defaulting happens
2939
2940       -Wtype-equality-out-of-scope
2941              warn when type equality a ~ b is used despite being out of scope
2942
2943       -Wtype-equality-requires-operators
2944              warn when type equality a ~ b is used despite being out of scope
2945
2946       -Wtyped-holes
2947              Report  warnings  when typed hole errors are deferred until run‐
2948              time. See -fdefer-typed-holes.
2949
2950       -Wunbanged-strict-patterns
2951              warn on pattern bind of unlifted variable that is  neither  bare
2952              nor banged
2953
2954       -Wunicode-bidirectional-format-characters
2955              warn  about  the  usage of unicode bidirectional layout override
2956              characters
2957
2958       -Wunrecognised-pragmas
2959              warn about uses of pragmas that GHC doesn't recognise
2960
2961       -Wunrecognised-warning-flags
2962              throw a warning when an unrecognised -W... flag  is  encountered
2963              on the command line.
2964
2965       -Wunsafe
2966              warn if the module being compiled is regarded to be unsafe.  See
2967              Safe Haskell
2968
2969       -Wunsupported-calling-conventions
2970              warn about use of an unsupported calling convention
2971
2972       -Wunsupported-llvm-version
2973              Warn when using -fllvm with an unsupported version of LLVM.
2974
2975       -Wunticked-promoted-constructors
2976              warn if promoted constructors are not ticked
2977
2978       -Wunused-binds
2979              warn   about   bindings   that    are    unused.    Alias    for
2980              -Wunused-top-binds,           -Wunused-local-binds           and
2981              -Wunused-pattern-binds
2982
2983       -Wunused-do-bind
2984              warn about do bindings that appear to throw away values of types
2985              other than ()
2986
2987       -Wunused-foralls
2988              warn  about type variables in user-written forall\s that are un‐
2989              used
2990
2991       -Wunused-imports
2992              warn about unnecessary imports
2993
2994       -Wunused-local-binds
2995              warn about local bindings that are unused
2996
2997       -Wunused-matches
2998              warn about variables in patterns that aren't used
2999
3000       -Wunused-packages
3001              warn when package is requested on command line, but not needed.
3002
3003       -Wunused-pattern-binds
3004              warn about pattern match bindings that are unused
3005
3006       -Wunused-record-wildcards
3007              Warn about record wildcard matches when none of the bound  vari‐
3008              ables are used.
3009
3010       -Wunused-top-binds
3011              warn about top-level bindings that are unused
3012
3013       -Wunused-type-patterns
3014              warn about unused type variables which arise from patterns in in
3015              type family and data family instances
3016
3017       -Wwarn make warnings non-fatal
3018
3019       -Wwarnings-deprecations
3020              warn about uses of functions & types that have DEPRECATED  prag‐
3021              mas, or WARNING pragmas with the deprecated category.  Alias for
3022              -Wdeprecations.
3023
3024       -Wwrong-do-bind
3025              warn about do bindings that appear to throw away monadic  values
3026              that you should have bound instead
3027
3028       -Wx-⟨category⟩
3029              warn  about  uses of functions & types that have WARNING pragmas
3030              with the given category
3031
3033       Copyright 2015. The University Court of the University of Glasgow.  All
3034       rights reserved.
3035

SEE ALSO

3037       https://www.haskell.org/ghc     the GHC homepage
3038

AUTHOR

3040       The GHC Team
3041
3043       2023, GHC Team
3044
3045
3046
3047
30489.8.1                            Nov 12, 2023                           GHC(1)
Impressum