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