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 and HTML; see
16 below.
17
18 Each of GHC's command line options is classified as either static or
19 dynamic. A static flag may only be specified on the command line,
20 whereas a dynamic flag may also be given in an OPTIONS pragma in a
21 source file or set from the GHCi command-line with :set .
22
23 As a rule of thumb, all the language options are dynamic, as are the
24 warning options and the debugging options.
25
26 The rest are static, with the notable exceptions of -v, -cpp, -fasm,
27 -fvia-C, -fllvm, and -#include. The OPTIONS sections lists the status
28 of each flag.
29
30 Common suffixes of file names for Haskell are:
31
32 .hs Haskell source code; preprocess, compile
33
34 .lhs literate Haskell source; unlit, preprocess, compile
35
36 .hi Interface file; contains information about exported symbols
37
38 .hc intermediate C files
39
40 .⟨way⟩_o
41 object files for "way" ⟨way⟩; common ways are:
42
43 dyn dynamically-linked
44
45 p built with profiling
46
47 .⟨way⟩_hi
48 interface files for "way" ⟨way⟩; common ways are:
49
51 Code generation
52 -dynamic-too -fasm -fbyte-code -fexternal-dynamic-refs -fllvm
53 -fno-code -fobject-code -fPIC -fPIE -fwrite-interface
54
55 Debugging the compiler
56 -dcmm-lint -dcore-lint -ddump-asm -ddump-asm-expanded
57 -ddump-asm-liveness -ddump-asm-native -ddump-asm-regalloc
58 -ddump-asm-regalloc-stages -ddump-asm-stats -ddump-bcos
59 -ddump-cfg-weights -ddump-cmm -ddump-cmm-caf -ddump-cmm-cbe
60 -ddump-cmm-cfg -ddump-cmm-cps -ddump-cmm-from-stg
61 -ddump-cmm-info -ddump-cmm-proc -ddump-cmm-procmap
62 -ddump-cmm-raw -ddump-cmm-sink -ddump-cmm-sp -ddump-cmm-split
63 -ddump-cmm-switch -ddump-cmm-verbose -ddump-core-stats
64 -ddump-cse -ddump-deriv -ddump-ds -ddump-ds-preopt
65 -ddump-ec-trace -ddump-file-prefix=⟨str⟩ -ddump-foreign
66 -ddump-hpc -ddump-if-trace -ddump-inlinings -ddump-json
67 -ddump-llvm -ddump-mod-map -ddump-occur-anal -ddump-opt-cmm
68 -ddump-parsed -ddump-parsed-ast -ddump-prep -ddump-rn
69 -ddump-rn-ast -ddump-rn-stats -ddump-rn-trace -ddump-rtti
70 -ddump-rule-firings -ddump-rule-rewrites -ddump-rules
71 -ddump-simpl -ddump-simpl-iterations -ddump-simpl-stats
72 -ddump-spec -ddump-splices -ddump-stg -ddump-str-signatures
73 -ddump-stranal -ddump-tc -ddump-tc-ast -ddump-tc-trace
74 -ddump-ticked -ddump-timings -ddump-to-file -ddump-types
75 -ddump-worker-wrapper -dfaststring-stats -dhex-word-literals
76 -dinitial-unique=⟨s⟩ -dinline-check=⟨str⟩ -dno-debug-output
77 -dppr-case-as-let -dppr-cols=⟨n⟩ -dppr-debug -dppr-user-length
78 -drule-check=⟨str⟩ -dshow-passes -dstg-lint -dsuppress-all
79 -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-pre‐
80 fixes -dsuppress-stg-free-vars -dsuppress-ticks -dsuppress-time‐
81 stamps -dsuppress-type-applications -dsuppress-type-signatures
82 -dsuppress-unfoldings -dsuppress-uniques -dsuppress-var-kinds
83 -dth-dec-file -dunique-increment=⟨i⟩ -dverbose-core2core -dver‐
84 bose-stg2stg -falignment-sanitisation -fcatch-bottoms
85 -fllvm-fill-undef-with-garbage -fproc-alignment -g -g⟨n⟩
86
87 C pre-processor
88 -cpp -D⟨symbol⟩[=⟨value⟩] -I⟨dir⟩ -U⟨symbol⟩
89
90 Finding imports
91 -i -i⟨dir⟩[:⟨dir⟩]*
92
93 Interactive mode
94 -fbreak-on-error -fbreak-on-exception -fghci-hist-size=⟨n⟩
95 -fghci-leak-check -flocal-ghci-history -fno-it
96 -fprint-bind-result -fshow-loaded-modules -ghci-script
97 -ignore-dot-ghci -interactive-print ⟨expr⟩
98
99 Interface files
100 --show-iface ⟨file⟩ -ddump-hi -ddump-hi-diffs -ddump-mini‐
101 mal-imports
102
103 Keeping intermediate files
104 -keep-hc-file -keep-hc-files -keep-hi-files -keep-hscpp-file
105 -keep-hscpp-files -keep-llvm-file -keep-llvm-files -keep-o-files
106 -keep-s-file -keep-s-files -keep-tmp-files
107
108 Language options
109 -fno-safe-haskell -fsort-by-size-hole-fits -fsort-by-subsump‐
110 tion-hole-fits -XAllowAmbiguousTypes -XApplicativeDo -XArrows
111 -XBangPatterns -XBinaryLiterals -XBlockArguments -XCApiFFI
112 -XConstrainedClassMethods -XConstraintKinds -XCPP -XDataKinds
113 -XDatatypeContexts -XDefaultSignatures -XDeriveAnyClass
114 -XDeriveDataTypeable -XDeriveFoldable -XDeriveFunctor -XDeriveG‐
115 eneric -XDeriveLift -XDeriveTraversable -XDerivingStrategies
116 -XDerivingVia -XDisambiguateRecordFields -XDuplicateRecordFields
117 -XEmptyCase -XEmptyDataDecls -XEmptyDataDeriving -XExisten‐
118 tialQuantification -XExplicitForAll -XExplicitNamespaces -XEx‐
119 tendedDefaultRules -XFlexibleContexts -XFlexibleInstances -XFor‐
120 eignFunctionInterface -XFunctionalDependencies -XGADTs -XGADT‐
121 Syntax -XGeneralisedNewtypeDeriving -XGeneralizedNewtypeDeriving
122 -XHexFloatLiterals -XImplicitParams -XImpredicativeTypes -XInco‐
123 herentInstances -XInstanceSigs -XInterruptibleFFI -XKindSigna‐
124 tures -XLambdaCase -XLiberalTypeSynonyms -XMagicHash -XMonadCom‐
125 prehensions -XMonadFailDesugaring -XMonoLocalBinds -XMultiParam‐
126 TypeClasses -XMultiWayIf -XNamedFieldPuns -XNamedWildCards
127 -XNegativeLiterals -XNoImplicitPrelude -XNoMonomorphismRestric‐
128 tion -XNoPatternGuards -XNoTraditionalRecordSyntax -XNPlusKPat‐
129 terns -XNullaryTypeClasses -XNumDecimals -XNumericUnderscores
130 -XOverlappingInstances -XOverloadedLabels -XOverloadedLists
131 -XOverloadedStrings -XPackageImports -XParallelListComp -XPar‐
132 tialTypeSignatures -XPatternSynonyms -XPolyKinds -XPostfixOpera‐
133 tors -XQuantifiedConstraints -XQuasiQuotes -XRank2Types -XRankN‐
134 Types -XRebindableSyntax -XRecordWildCards -XRecursiveDo
135 -XRoleAnnotations -XSafe -XScopedTypeVariables -XStandaloneD‐
136 eriving -XStarIsType -XStaticPointers -XStrict -XStrictData
137 -XTemplateHaskell -XTemplateHaskellQuotes -XTransformListComp
138 -XTrustworthy -XTupleSections -XTypeApplications -XTypeFamilies
139 -XTypeFamilyDependencies -XTypeInType -XTypeOperators -XTypeSyn‐
140 onymInstances -XUnboxedSums -XUnboxedTuples -XUndecidableIn‐
141 stances -XUndecidableSuperClasses -XUnicodeSyntax -XUnsafe
142 -XViewPatterns
143
144 Linking options
145 -c -debug -dylib-install-name ⟨path⟩ -dynamic -dynload -eventlog
146 -fno-embed-manifest -fno-gen-manifest -fno-shared-implib -frame‐
147 work ⟨name⟩ -framework-path ⟨dir⟩ -fwhole-archive-hs-libs
148 -keep-cafs -L ⟨dir⟩ -l ⟨lib⟩ -main-is ⟨thing⟩ -no-hs-main
149 -no-rtsopts-suggestions -package ⟨name⟩ -pie -rdynamic
150 -rtsopts[=⟨none|some|all|ignore|ignoreAll⟩] -shared -split-objs
151 -split-sections -static -staticlib -threaded
152 -with-rtsopts=⟨opts⟩
153
154 Miscellaneous options
155 -fexternal-interpreter -fglasgow-exts -ghcversion-file ⟨path to
156 ghcversion.h⟩ -H ⟨size⟩ -j[⟨n⟩]
157
158 Modes of operation
159 --frontend ⟨module⟩ --help -? --info --interactive --make
160 --mk-dll --numeric-version --print-libdir --show-iface ⟨file⟩
161 --show-options --supported-extensions --supported-languages
162 --version -V -e ⟨expr⟩ -M
163
164 Individual optimizations
165 -fasm-shortcutting -fblock-layout-cfg -fblock-layout-weightless
166 -fblock-layout-weights -fcall-arity -fcase-folding -fcase-merge
167 -fcmm-elim-common-blocks -fcmm-sink -fcpr-anal -fcross-mod‐
168 ule-specialise -fcse -fdicts-cheap -fdicts-strict
169 -fdmd-tx-dict-sel -fdo-eta-reduction -fdo-lambda-eta-expansion
170 -feager-blackholing -fenable-rewrite-rules -fexcess-precision
171 -fexitification -fexpose-all-unfoldings -ffloat-in -ffull-lazi‐
172 ness -ffun-to-thunk -fignore-asserts -fignore-interface-pragmas
173 -flate-dmd-anal -flate-specialise -fliberate-case -fliber‐
174 ate-case-threshold=⟨n⟩ -fllvm-pass-vectors-in-regs -floopifica‐
175 tion -fmax-inline-alloc-size=⟨n⟩ -fmax-inline-memcpy-insns=⟨n⟩
176 -fmax-inline-memset-insns=⟨n⟩ -fmax-simplifier-iterations=⟨n⟩
177 -fmax-uncovered-patterns=⟨n⟩ -fmax-worker-args=⟨n⟩
178 -fno-opt-coercion -fno-pre-inlining -fno-state-hack
179 -fomit-interface-pragmas -fomit-yields -foptimal-applicative-do
180 -fpedantic-bottoms -fregs-graph -fregs-iterative
181 -fsimpl-tick-factor=⟨n⟩ -fsimplifier-phases=⟨n⟩ -fsolve-con‐
182 stant-dicts -fspec-constr -fspec-constr-count=⟨n⟩ -fspec-con‐
183 str-keen -fspec-constr-threshold=⟨n⟩ -fspecialise -fspe‐
184 cialise-aggressively -fstatic-argument-transformation -fstg-cse
185 -fstg-lift-lams -fstg-lift-lams-known
186 -fstg-lift-lams-non-rec-args -fstg-lift-lams-rec-args -fstrict‐
187 ness -fstrictness-before=⟨n⟩ -funbox-small-strict-fields -fun‐
188 box-strict-fields -funfolding-creation-threshold=⟨n⟩ -funfold‐
189 ing-dict-discount=⟨n⟩ -funfolding-fun-discount=⟨n⟩ -funfold‐
190 ing-keeness-factor=⟨n⟩ -funfolding-use-threshold=⟨n⟩
191
192 Optimization levels
193 -O -O1 -O0 -O2
194
195 Package options
196 -clear-package-db -distrust ⟨pkg⟩ -distrust-all-packages -fpack‐
197 age-trust -global-package-db -hide-all-packages -hide-package
198 ⟨pkg⟩ -ignore-package ⟨pkg⟩ -no-auto-link-packages
199 -no-global-package-db -no-user-package-db -package ⟨pkg⟩ -pack‐
200 age-db ⟨file⟩ -package-env ⟨file⟩|⟨name⟩ -package-id ⟨unit-id⟩
201 -this-unit-id ⟨unit-id⟩ -trust ⟨pkg⟩ -user-package-db
202
203 Phases of compilation
204 -C -c -E -F -S -x ⟨suffix⟩
205
206 Overriding external programs
207 -pgma ⟨cmd⟩ -pgmc ⟨cmd⟩ -pgmdll ⟨cmd⟩ -pgmF ⟨cmd⟩ -pgmi ⟨cmd⟩
208 -pgmL ⟨cmd⟩ -pgml ⟨cmd⟩ -pgmlc ⟨cmd⟩ -pgmlibtool ⟨cmd⟩ -pgmlo
209 ⟨cmd⟩ -pgmP ⟨cmd⟩ -pgms ⟨cmd⟩ -pgmwindres ⟨cmd⟩
210
211 Phase-specific options
212 -opta ⟨option⟩ -optc ⟨option⟩ -optdll ⟨option⟩ -optF ⟨option⟩
213 -opti ⟨option⟩ -optL ⟨option⟩ -optl ⟨option⟩ -optlc ⟨option⟩
214 -optlo ⟨option⟩ -optP ⟨option⟩ -optwindres ⟨option⟩
215
216 Platform-specific options
217 -msse2 -msse4.2
218
219 Compiler plugins
220 -fclear-plugins -fplugin-opt=⟨module⟩:⟨args⟩ -fplugin=⟨module⟩
221 -hide-all-plugin-packages -plugin-package ⟨pkg⟩ -plugin-pack‐
222 age-id ⟨pkg-id⟩
223
224 Profiling
225 -fno-prof-auto -fno-prof-cafs -fno-prof-count-entries
226 -fprof-auto -fprof-auto-calls -fprof-auto-exported
227 -fprof-auto-top -fprof-cafs -prof -ticky
228
229 Program coverage
230 -fhpc
231
232 Recompilation checking
233 -fforce-recomp -fignore-hpc-changes -fignore-optim-changes
234
235 Redirecting output
236 --exclude-module=⟨file⟩ -ddump-mod-cycles -dep-makefile ⟨file⟩
237 -dep-suffix ⟨suffix⟩ -dumpdir ⟨dir⟩ -hcsuf ⟨suffix⟩ -hidir ⟨dir⟩
238 -hiedir ⟨dir⟩ -hiesuf ⟨suffix⟩ -hisuf ⟨suffix⟩ -include-pkg-deps
239 -o ⟨file⟩ -odir ⟨dir⟩ -ohi ⟨file⟩ -osuf ⟨suffix⟩ -outputdir
240 ⟨dir⟩ -stubdir ⟨dir⟩
241
242 Temporary files
243 -tmpdir ⟨dir⟩
244
245 Verbosity options
246 -fabstract-refinement-hole-fits -fdiagnos‐
247 tics-color=⟨always|auto|never⟩ -fdiagnostics-show-caret -fer‐
248 ror-spans -fhide-source-paths -fmax-refinement-hole-fits=⟨n⟩
249 -fmax-relevant-binds=⟨n⟩ -fmax-valid-hole-fits=⟨n⟩
250 -fno-show-valid-hole-fits -fno-sort-valid-hole-fits
251 -fprint-equality-relations -fprint-expanded-synonyms
252 -fprint-explicit-coercions -fprint-explicit-foralls
253 -fprint-explicit-kinds -fprint-explicit-runtime-reps
254 -fprint-explicit-runtime-reps -fprint-potential-instances
255 -fprint-typechecker-elaboration -fprint-unicode-syntax -frefine‐
256 ment-level-hole-fits=⟨n⟩ -freverse-errors
257 -fshow-docs-of-hole-fits -fshow-hole-constraints
258 -fshow-hole-matches-of-hole-fits -fshow-provenance-of-hole-fits
259 -fshow-type-app-of-hole-fits -fshow-type-app-vars-of-hole-fits
260 -fshow-type-of-hole-fits -funclutter-valid-hole-fits -Rghc-tim‐
261 ing -v -v⟨n⟩
262
263 Warnings
264 -fdefer-out-of-scope-variables -fdefer-type-errors -fde‐
265 fer-typed-holes -fhelpful-errors -fmax-pmcheck-iterations=⟨n⟩
266 -fshow-warning-groups -W -w -Wall -Wall-missed-specialisations
267 -Wcompat -Wcpp-undef -Wdeferred-out-of-scope-variables -Wde‐
268 ferred-type-errors -Wdeprecated-flags -Wdeprecations
269 -Wdodgy-exports -Wdodgy-foreign-imports -Wdodgy-imports -Wdupli‐
270 cate-constraints -Wduplicate-exports -Wempty-enumerations -Wer‐
271 ror -Weverything -Whi-shadowing -Widentities -Wim‐
272 plicit-kind-vars -Wimplicit-prelude -Winaccessible-code -Wincom‐
273 plete-patterns -Wincomplete-record-updates -Wincomplete-uni-pat‐
274 terns -Winline-rule-shadowing -Wmissed-extra-shared-lib
275 -Wmissed-specialisations -Wmissing-deriving-strategies -Wmiss‐
276 ing-export-lists -Wmissing-exported-signatures -Wmiss‐
277 ing-exported-sigs -Wmissing-fields -Wmissing-home-modules
278 -Wmissing-import-lists -Wmissing-local-signatures -Wmiss‐
279 ing-local-sigs -Wmissing-methods -Wmissing-monadfail-instances
280 -Wmissing-pattern-synonym-signatures -Wmissing-signatures
281 -Wmonomorphism-restriction -Wname-shadowing -Wno-compat -Wnon‐
282 canonical-monad-instances -Wnoncanonical-monadfail-instances
283 -Wnoncanonical-monoid-instances -Worphans -Woverflowed-literals
284 -Woverlapping-patterns -Wpartial-fields -Wpartial-type-signa‐
285 tures -Wredundant-constraints -Wsafe -Wsemigroup -Wsimplifi‐
286 able-class-constraints -Wspace-after-bang -Wstar-binder
287 -Wstar-is-type -Wtabs -Wtrustworthy-safe -Wtype-defaults
288 -Wtyped-holes -Wunbanged-strict-patterns -Wunrecognised-pragmas
289 -Wunrecognised-warning-flags -Wunsafe -Wunsupported-calling-con‐
290 ventions -Wunsupported-llvm-version -Wunticked-promoted-con‐
291 structors -Wunused-binds -Wunused-do-bind -Wunused-foralls
292 -Wunused-imports -Wunused-local-binds -Wunused-matches
293 -Wunused-pattern-binds -Wunused-top-binds -Wunused-type-patterns
294 -Wwarn -Wwarnings-deprecations -Wwrong-do-bind
295
296 Code generation
297 -dynamic-too
298 Build dynamic object files as well as static object files during
299 compilation
300
301 -fasm Use the native code generator
302
303 -fbyte-code
304 Generate byte-code
305
306 -fexternal-dynamic-refs
307 Generate code for linking against dynamic libraries
308
309 -fllvm Compile using the LLVM code generator
310
311 -fno-code
312 Omit code generation
313
314 -fobject-code
315 Generate object code
316
317 -fPIC Generate position-independent code (where available)
318
319 -fPIE Generate code for a position-independent executable (where
320 available)
321
322 -fwrite-interface
323 Always write interface files
324
325 Debugging the compiler
326 -dcmm-lint
327 C-\- pass sanity checking
328
329 -dcore-lint
330 Turn on internal sanity checking
331
332 -ddump-asm
333 Dump final assembly
334
335 -ddump-asm-expanded
336 Dump the result of the synthetic instruction expansion pass.
337
338 -ddump-asm-liveness
339 Dump assembly augmented with register liveness
340
341 -ddump-asm-native
342 Dump initial assembly
343
344 -ddump-asm-regalloc
345 Dump the result of register allocation
346
347 -ddump-asm-regalloc-stages
348 Dump the build/spill stages of the -fregs-graph register alloca‐
349 tor.
350
351 -ddump-asm-stats
352 Dump statistics from the register allocator.
353
354 -ddump-bcos
355 Dump interpreter byte code
356
357 -ddump-cfg-weights
358 Dump the assumed weights of the CFG.
359
360 -ddump-cmm
361 Dump the final C-\- output
362
363 -ddump-cmm-caf
364 Dump the results of the C-\- CAF analysis pass.
365
366 -ddump-cmm-cbe
367 Dump the results of common block elimination
368
369 -ddump-cmm-cfg
370 Dump the results of the C-\- control flow optimisation pass.
371
372 -ddump-cmm-cps
373 Dump the results of the CPS pass
374
375 -ddump-cmm-from-stg
376 Dump STG-to-C-\- output
377
378 -ddump-cmm-info
379 Dump the results of the C-\- info table augmentation pass.
380
381 -ddump-cmm-proc
382 Dump the results of proc-point analysis
383
384 -ddump-cmm-procmap
385 Dump the results of the C-\- proc-point map pass.
386
387 -ddump-cmm-raw
388 Dump raw C-\-
389
390 -ddump-cmm-sink
391 Dump the results of the C-\- sinking pass.
392
393 -ddump-cmm-sp
394 Dump the results of the C-\- stack layout pass.
395
396 -ddump-cmm-split
397 Dump the results of the C-\- proc-point splitting pass.
398
399 -ddump-cmm-switch
400 Dump the results of switch lowering passes
401
402 -ddump-cmm-verbose
403 Show output from main C-\- pipeline passes
404
405 -ddump-core-stats
406 Print a one-line summary of the size of the Core program at the
407 end of the optimisation pipeline
408
409 -ddump-cse
410 Dump CSE output
411
412 -ddump-deriv
413 Dump deriving output
414
415 -ddump-ds
416 Dump desugarer output.
417
418 -ddump-ec-trace
419 Trace exhaustiveness checker
420
421 -ddump-file-prefix=⟨str⟩
422 Set the prefix of the filenames used for debugging output.
423
424 -ddump-foreign
425 Dump foreign export stubs
426
427 -ddump-hpc
428 An alias for -ddump-ticked.
429
430 -ddump-if-trace
431 Trace interface files
432
433 -ddump-inlinings
434 Dump inlining info
435
436 -ddump-json
437 Dump error messages as JSON documents
438
439 -ddump-llvm
440 Dump LLVM intermediate code.
441
442 -ddump-mod-map
443 Dump the state of the module mapping database.
444
445 -ddump-occur-anal
446 Dump occurrence analysis output
447
448 -ddump-opt-cmm
449 Dump the results of C-\- to C-\- optimising passes
450
451 -ddump-parsed
452 Dump parse tree
453
454 -ddump-parsed-ast
455 Dump parser output as a syntax tree
456
457 -ddump-prep
458 Dump prepared core
459
460 -ddump-rn
461 Dump renamer output
462
463 -ddump-rn-ast
464 Dump renamer output as a syntax tree
465
466 -ddump-rn-stats
467 Renamer stats
468
469 -ddump-rn-trace
470 Trace renamer
471
472 -ddump-rtti
473 Trace runtime type inference
474
475 -ddump-rule-firings
476 Dump rule firing info
477
478 -ddump-rule-rewrites
479 Dump detailed rule firing info
480
481 -ddump-rules
482 Dump rewrite rules
483
484 -ddump-simpl
485 Dump final simplifier output
486
487 -ddump-simpl-iterations
488 Dump output from each simplifier iteration
489
490 -ddump-simpl-stats
491 Dump simplifier stats
492
493 -ddump-spec
494 Dump specialiser output
495
496 -ddump-splices
497 Dump TH spliced expressions, and what they evaluate to
498
499 -ddump-stg
500 Dump final STG
501
502 -ddump-str-signatures
503 Dump strictness signatures
504
505 -ddump-stranal
506 Dump strictness analyser output
507
508 -ddump-tc
509 Dump typechecker output
510
511 -ddump-tc-ast
512 Dump typechecker output as a syntax tree
513
514 -ddump-tc-trace
515 Trace typechecker
516
517 -ddump-ticked
518 Dump the code instrumented by HPC (hpc).
519
520 -ddump-timings
521 Dump per-pass timing and allocation statistics
522
523 -ddump-to-file
524 Dump to files instead of stdout
525
526 -ddump-types
527 Dump type signatures
528
529 -ddump-worker-wrapper
530 Dump worker-wrapper output
531
532 -dfaststring-stats
533 Show statistics for fast string usage when finished
534
535 -dhex-word-literals
536 Print values of type Word# in hexadecimal.
537
538 -dinitial-unique=⟨s⟩
539 Start UniqSupply allocation from ⟨s⟩.
540
541 -dinline-check=⟨str⟩
542 Dump information about inlining decisions
543
544 -dno-debug-output
545 Suppress unsolicited debugging output
546
547 -dppr-case-as-let
548 Print single alternative case expressions as strict lets.
549
550 -dppr-cols=⟨n⟩
551 Set the width of debugging output. For example -dppr-cols200
552
553 -dppr-debug
554 Turn on debug printing (more verbose)
555
556 -dppr-user-length
557 Set the depth for printing expressions in error msgs
558
559 -drule-check=⟨str⟩
560 Dump information about potential rule application
561
562 -dshow-passes
563 Print out each pass name as it happens
564
565 -dstg-lint
566 STG pass sanity checking
567
568 -dsuppress-all
569 In dumps, suppress everything (except for uniques) that is sup‐
570 pressible.
571
572 -dsuppress-coercions
573 Suppress the printing of coercions in Core dumps to make them
574 shorter
575
576 -dsuppress-idinfo
577 Suppress extended information about identifiers where they are
578 bound
579
580 -dsuppress-module-prefixes
581 Suppress the printing of module qualification prefixes
582
583 -dsuppress-stg-free-vars
584 Suppress the printing of closure free variable lists in STG out‐
585 put
586
587 -dsuppress-ticks
588 Suppress "ticks" in the pretty-printer output.
589
590 -dsuppress-timestamps
591 Suppress timestamps in dumps
592
593 -dsuppress-type-applications
594 Suppress type applications
595
596 -dsuppress-type-signatures
597 Suppress type signatures
598
599 -dsuppress-unfoldings
600 Suppress the printing of the stable unfolding of a variable at
601 its binding site
602
603 -dsuppress-uniques
604 Suppress the printing of uniques in debug output (easier to use
605 diff)
606
607 -dsuppress-var-kinds
608 Suppress the printing of variable kinds
609
610 -dth-dec-file
611 Dump evaluated TH declarations into *.th.hs files
612
613 -dunique-increment=⟨i⟩
614 Set the increment for the generated Unique's to ⟨i⟩.
615
616 -dverbose-core2core
617 Show output from each core-to-core pass
618
619 -dverbose-stg2stg
620 Show output from each STG-to-STG pass
621
622 -falignment-sanitisation
623 Compile with alignment checks for all info table dereferences.
624
625 -fcatch-bottoms
626 Insert error expressions after bottoming expressions; useful
627 when debugging the compiler.
628
629 -fllvm-fill-undef-with-garbage
630 Intruct LLVM to fill dead STG registers with garbage
631
632 -fproc-alignment
633 Align functions at given boundary.
634
635 -g Produce DWARF debug information in compiled object files. ⟨n⟩
636 can be 0, 1, or 2, with higher numbers producing richer output.
637 If ⟨n⟩ is omitted, level 2 is assumed.
638
639 C pre-processor
640 -cpp Run the C pre-processor on Haskell source files
641
642 -D⟨symbol⟩[=⟨value⟩]
643 Define a symbol in the C pre-processor
644
645 -I⟨dir⟩
646 Add ⟨dir⟩ to the directory search list for #include files
647
648 -U⟨symbol⟩
649 Undefine a symbol in the C pre-processor
650
651 Finding imports
652 -i Empty the import directory list
653
654 -i⟨dir⟩[:⟨dir⟩]*
655 add ⟨dir⟩, ⟨dir2⟩, etc. to import path
656
657 Interactive mode
658 -fbreak-on-error
659 Break on uncaught exceptions and errors
660
661 -fbreak-on-exception
662 Break on any exception thrown
663
664 -fghci-hist-size=⟨n⟩
665 Set the number of entries GHCi keeps for :history. See
666 ghci-debugger.
667
668 -fghci-leak-check
669 (Debugging only) check for space leaks when loading new modules
670 in GHCi.
671
672 -flocal-ghci-history
673 Use current directory for the GHCi command history file
674 .ghci-history.
675
676 -fno-it
677 No longer set the special variable it.
678
679 -fprint-bind-result
680 Turn on printing of binding results in GHCi
681
682 -fshow-loaded-modules
683 Show the names of modules that GHCi loaded after a :load com‐
684 mand.
685
686 -ghci-script
687 Read additional .ghci files
688
689 -ignore-dot-ghci
690 Disable reading of .ghci files
691
692 -interactive-print ⟨expr⟩
693 Select the function to use for printing evaluated expressions in
694 GHCi
695
696 Interface files
697 --show-iface ⟨file⟩
698 See modes.
699
700 -ddump-hi
701 Dump the new interface to stdout
702
703 -ddump-hi-diffs
704 Show the differences vs. the old interface
705
706 -ddump-minimal-imports
707 Dump a minimal set of imports
708
709 Keeping intermediate files
710 -keep-hc-file
711 Retain intermediate .hc files.
712
713 -keep-hi-files
714 Retain intermediate .hi files (the default).
715
716 -keep-hscpp-file
717 Retain intermediate .hscpp files.
718
719 -keep-llvm-file
720 Retain intermediate LLVM .ll files. Implies -fllvm.
721
722 -keep-o-files
723 Retain intermediate .o files (the default).
724
725 -keep-s-file
726 Retain intermediate .s files.
727
728 -keep-tmp-files
729 Retain all intermediate temporary files.
730
731 Language options
732 -fno-safe-haskell
733 Disable Safe Haskell
734
735 -fsort-by-size-hole-fits
736 Sort valid hole fits by size.
737
738 -fsort-by-subsumption-hole-fits
739 Sort valid hole fits by subsumption.
740
741 -XAllowAmbiguousTypes
742 Allow the user to write ambiguous types, and the type inference
743 engine to infer them.
744
745 -XApplicativeDo
746 Enable Applicative do-notation desugaring
747
748 -XArrows
749 Enable arrow notation extension
750
751 -XBangPatterns
752 Enable bang patterns.
753
754 -XBinaryLiterals
755 Enable support for binary literals.
756
757 -XBlockArguments
758 Allow do blocks and other constructs as function arguments.
759
760 -XCApiFFI
761 Enable the CAPI calling convention.
762
763 -XConstrainedClassMethods
764 Enable constrained class methods.
765
766 -XConstraintKinds
767 Enable a kind of constraints.
768
769 -XCPP Enable the C preprocessor.
770
771 -XDataKinds
772 Enable datatype promotion.
773
774 -XDatatypeContexts
775 Allow contexts on data types.
776
777 -XDefaultSignatures
778 Enable default signatures.
779
780 -XDeriveAnyClass
781 Enable deriving for any class.
782
783 -XDeriveDataTypeable
784 Enable deriving for the Data class. Implied by (deprecated)
785 AutoDeriveTypeable.
786
787 -XDeriveFoldable
788 Enable deriving for the Foldable class. Implied by Derive‐
789 Traversable.
790
791 -XDeriveFunctor
792 Enable deriving for the Functor class. Implied by Derive‐
793 Traversable.
794
795 -XDeriveGeneric
796 Enable deriving for the Generic class.
797
798 -XDeriveLift
799 Enable deriving for the Lift class
800
801 -XDeriveTraversable
802 Enable deriving for the Traversable class. Implies DeriveFunc‐
803 tor and DeriveFoldable.
804
805 -XDerivingStrategies
806 Enables deriving strategies.
807
808 -XDerivingVia
809 Enable deriving instances via types of the same runtime repre‐
810 sentation. Implies DerivingStrategies.
811
812 -XDisambiguateRecordFields
813 Enable record field disambiguation. Implied by RecordWildCards.
814
815 -XDuplicateRecordFields
816 Allow definition of record types with identically-named fields.
817
818 -XEmptyCase
819 Allow empty case alternatives.
820
821 -XEmptyDataDecls
822 Allow definition of empty data types.
823
824 -XEmptyDataDeriving
825 Allow deriving instances of standard type classes for empty data
826 types.
827
828 -XExistentialQuantification
829 Enable liberalised type synonyms.
830
831 -XExplicitForAll
832 Enable explicit universal quantification. Implied by Scoped‐
833 TypeVariables, LiberalTypeSynonyms, RankNTypes and Existen‐
834 tialQuantification.
835
836 -XExplicitNamespaces
837 Enable using the keyword type to specify the namespace of
838 entries in imports and exports (explicit-namespaces). Implied
839 by TypeOperators and TypeFamilies.
840
841 -XExtendedDefaultRules
842 Use GHCi's extended default rules in a normal module.
843
844 -XFlexibleContexts
845 Enable flexible contexts. Implied by ImplicitParams.
846
847 -XFlexibleInstances
848 Enable flexible instances. Implies TypeSynonymInstances.
849 Implied by ImplicitParams.
850
851 -XForeignFunctionInterface
852 Enable foreign function interface.
853
854 -XFunctionalDependencies
855 Enable functional dependencies. Implies MultiParamTypeClasses.
856
857 -XGADTs
858 Enable generalised algebraic data types. Implies GADTSyntax and
859 MonoLocalBinds.
860
861 -XGADTSyntax
862 Enable generalised algebraic data type syntax.
863
864 -XGeneralisedNewtypeDeriving
865 Enable newtype deriving.
866
867 -XGeneralizedNewtypeDeriving
868 Enable newtype deriving.
869
870 -XHexFloatLiterals
871 Enable support for hexadecimal floating point literals.
872
873 -XImplicitParams
874 Enable Implicit Parameters. Implies FlexibleContexts and Flexi‐
875 bleInstances.
876
877 -XImpredicativeTypes
878 Enable impredicative types. Implies RankNTypes.
879
880 -XIncoherentInstances
881 Enable incoherent instances. Implies OverlappingInstances.
882
883 -XInstanceSigs
884 Enable instance signatures.
885
886 -XInterruptibleFFI
887 Enable interruptible FFI.
888
889 -XKindSignatures
890 Enable kind signatures. Implied by TypeFamilies and PolyKinds.
891
892 -XLambdaCase
893 Enable lambda-case expressions.
894
895 -XLiberalTypeSynonyms
896 Enable liberalised type synonyms.
897
898 -XMagicHash
899 Allow # as a postfix modifier on identifiers.
900
901 -XMonadComprehensions
902 Enable monad comprehensions.
903
904 -XMonadFailDesugaring
905 Enable monadfail desugaring.
906
907 -XMonoLocalBinds
908 Enable do not generalise local bindings. Implied by TypeFami‐
909 lies and GADTs.
910
911 -XMultiParamTypeClasses
912 Enable multi parameter type classes. Implied by FunctionalDe‐
913 pendencies.
914
915 -XMultiWayIf
916 Enable multi-way if-expressions.
917
918 -XNamedFieldPuns
919 Enable record puns.
920
921 -XNamedWildCards
922 Enable named wildcards.
923
924 -XNegativeLiterals
925 Enable support for negative literals.
926
927 -XNoImplicitPrelude
928 Don't implicitly import Prelude. Implied by RebindableSyntax.
929
930 -XNoMonomorphismRestriction
931 Disable the monomorphism restriction.
932
933 -XNoPatternGuards
934 Disable pattern guards. Implied by Haskell98.
935
936 -XNoTraditionalRecordSyntax
937 Disable support for traditional record syntax (as supported by
938 Haskell 98) C {f = x}
939
940 -XNPlusKPatterns
941 Enable support for n+k patterns. Implied by Haskell98.
942
943 -XNullaryTypeClasses
944 Deprecated, does nothing. nullary (no parameter) type classes
945 are now enabled using MultiParamTypeClasses.
946
947 -XNumDecimals
948 Enable support for 'fractional' integer literals.
949
950 -XNumericUnderscores
951 Enable support for numeric underscores.
952
953 -XOverlappingInstances
954 Enable overlapping instances.
955
956 -XOverloadedLabels
957 Enable overloaded labels.
958
959 -XOverloadedLists
960 Enable overloaded lists.
961
962 -XOverloadedStrings
963 Enable overloaded string literals.
964
965 -XPackageImports
966 Enable package-qualified imports.
967
968 -XParallelListComp
969 Enable parallel list comprehensions.
970
971 -XPartialTypeSignatures
972 Enable partial type signatures.
973
974 -XPatternSynonyms
975 Enable pattern synonyms.
976
977 -XPolyKinds
978 Enable kind polymorphism. Implies KindSignatures.
979
980 -XPostfixOperators
981 Enable postfix operators.
982
983 -XQuantifiedConstraints
984 Allow forall quantifiers in constraints.
985
986 -XQuasiQuotes
987 Enable quasiquotation.
988
989 -XRank2Types
990 Enable rank-2 types. Synonym for RankNTypes.
991
992 -XRankNTypes
993 Enable rank-N types. Implied by ImpredicativeTypes.
994
995 -XRebindableSyntax
996 Employ rebindable syntax. Implies NoImplicitPrelude.
997
998 -XRecordWildCards
999 Enable record wildcards. Implies DisambiguateRecordFields.
1000
1001 -XRecursiveDo
1002 Enable recursive do (mdo) notation.
1003
1004 -XRoleAnnotations
1005 Enable role annotations.
1006
1007 -XSafe Enable the Safe Haskell Safe mode.
1008
1009 -XScopedTypeVariables
1010 Enable lexically-scoped type variables.
1011
1012 -XStandaloneDeriving
1013 Enable standalone deriving.
1014
1015 -XStarIsType
1016 Treat * as Data.Kind.Type.
1017
1018 -XStaticPointers
1019 Enable static pointers.
1020
1021 -XStrict
1022 Make bindings in the current module strict by default.
1023
1024 -XStrictData
1025 Enable default strict datatype fields.
1026
1027 -XTemplateHaskell
1028 Enable Template Haskell.
1029
1030 -XTemplateHaskellQuotes
1031 Enable quotation subset of Template Haskell.
1032
1033 -XTransformListComp
1034 Enable generalised list comprehensions.
1035
1036 -XTrustworthy
1037 Enable the Safe Haskell Trustworthy mode.
1038
1039 -XTupleSections
1040 Enable tuple sections.
1041
1042 -XTypeApplications
1043 Enable type application syntax in terms and types.
1044
1045 -XTypeFamilies
1046 Enable type families. Implies ExplicitNamespaces, KindSigna‐
1047 tures, and MonoLocalBinds.
1048
1049 -XTypeFamilyDependencies
1050 Enable injective type families. Implies TypeFamilies.
1051
1052 -XTypeInType
1053 Deprecated. Enable kind polymorphism and datatype promotion.
1054
1055 -XTypeOperators
1056 Enable type operators. Implies ExplicitNamespaces.
1057
1058 -XTypeSynonymInstances
1059 Enable type synonyms in instance heads. Implied by FlexibleIn‐
1060 stances.
1061
1062 -XUnboxedSums
1063 Enable unboxed sums.
1064
1065 -XUnboxedTuples
1066 Enable the use of unboxed tuple syntax.
1067
1068 -XUndecidableInstances
1069 Enable undecidable instances.
1070
1071 -XUndecidableSuperClasses
1072 Allow all superclass constraints, including those that may
1073 result in non-termination of the typechecker.
1074
1075 -XUnicodeSyntax
1076 Enable unicode syntax.
1077
1078 -XUnsafe
1079 Enable Safe Haskell Unsafe mode.
1080
1081 -XViewPatterns
1082 Enable view patterns.
1083
1084 Linking options
1085 -c Stop after generating object (.o) file
1086
1087 -debug Use the debugging runtime
1088
1089 -dylib-install-name ⟨path⟩
1090 Set the install name (via -install_name passed to Apple's
1091 linker), specifying the full install path of the library file.
1092 Any libraries or executables that link with it later will pick
1093 up that path as their runtime search location for it. (Dar‐
1094 win/OS X only)
1095
1096 -dynamic
1097 Build dynamically-linked object files and executables
1098
1099 -dynload
1100 Selects one of a number of modes for finding shared libraries at
1101 runtime.
1102
1103 -eventlog
1104 Enable runtime event tracing
1105
1106 -fno-embed-manifest
1107 Do not embed the manifest in the executable (Windows only)
1108
1109 -fno-gen-manifest
1110 Do not generate a manifest file (Windows only)
1111
1112 -fno-shared-implib
1113 Don't generate an import library for a DLL (Windows only)
1114
1115 -framework ⟨name⟩
1116 On Darwin/OS X/iOS only, link in the framework ⟨name⟩. This
1117 option corresponds to the -framework option for Apple's Linker.
1118
1119 -framework-path ⟨dir⟩
1120 On Darwin/OS X/iOS only, add ⟨dir⟩ to the list of directories
1121 searched for frameworks. This option corresponds to the -F
1122 option for Apple's Linker.
1123
1124 -fwhole-archive-hs-libs
1125 When linking a binary executable, this inserts the flag
1126 -Wl,--whole-archive before any -l flags for Haskell libraries,
1127 and -Wl,--no-whole-archive afterwards
1128
1129 -keep-cafs
1130 Do not garbage-collect CAFs (top-level expressions) at runtime
1131
1132 -L ⟨dir⟩
1133 Add ⟨dir⟩ to the list of directories searched for libraries
1134
1135 -l ⟨lib⟩
1136 Link in library ⟨lib⟩
1137
1138 -main-is ⟨thing⟩
1139 Set main module and function
1140
1141 -no-hs-main
1142 Don't assume this program contains main
1143
1144 -no-rtsopts-suggestions
1145 Don't print RTS suggestions about linking with
1146 -rtsopts[=⟨none|some|all|ignore|ignoreAll⟩].
1147
1148 -package ⟨name⟩
1149 Expose package ⟨pkg⟩
1150
1151 -pie Instruct the linker to produce a position-independent exe‐
1152 cutable.
1153
1154 -rdynamic
1155 This instructs the linker to add all symbols, not only used
1156 ones, to the dynamic symbol table. Currently Linux and Win‐
1157 dows/MinGW32 only. This is equivalent to using -optl -rdynamic
1158 on Linux, and -optl -export-all-symbols on Windows.
1159
1160 -rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]
1161 Control whether the RTS behaviour can be tweaked via com‐
1162 mand-line flags and the GHCRTS environment variable. Using none
1163 means no RTS flags can be given; some means only a minimum of
1164 safe options can be given (the default); all (or no argument at
1165 all) means that all RTS flags are permitted; ignore means RTS
1166 flags can be given, but are treated as regular arguments and
1167 passed to the Haskell program as arguments; ignoreAll is the
1168 same as ignore, but GHCRTS is also ignored. -rtsopts does not
1169 affect -with-rtsopts behavior; flags passed via -with-rtsopts
1170 are used regardless of -rtsopts.
1171
1172 -shared
1173 Generate a shared library (as opposed to an executable)
1174
1175 -split-objs
1176 Split objects (for libraries)
1177
1178 -split-sections
1179 Split sections for link-time dead-code stripping
1180
1181 -static
1182 Use static Haskell libraries
1183
1184 -staticlib
1185 Generate a standalone static library (as opposed to an exe‐
1186 cutable). This is useful when cross compiling. The library
1187 together with all its dependencies ends up in in a single static
1188 library that can be linked against.
1189
1190 -threaded
1191 Use the threaded runtime
1192
1193 -with-rtsopts=⟨opts⟩
1194 Set the default RTS options to ⟨opts⟩.
1195
1196 Miscellaneous options
1197 -fexternal-interpreter
1198 Run interpreted code in a separate process
1199
1200 -fglasgow-exts
1201 Deprecated. Enable most language extensions; see options-lan‐
1202 guage for exactly which ones.
1203
1204 -ghcversion-file ⟨path to ghcversion.h⟩
1205 (GHC as a C compiler only) Use this ghcversion.h file
1206
1207 -H ⟨size⟩
1208 Set the minimum size of the heap to ⟨size⟩
1209
1210 -j[⟨n⟩]
1211 When compiling with --make, compile ⟨n⟩ modules in parallel.
1212
1213 Modes of operation
1214 --frontend ⟨module⟩
1215 run GHC with the given frontend plugin; see frontend_plugins for
1216 details.
1217
1218 --help Display help
1219
1220 --info display information about the compiler
1221
1222 --interactive
1223 Interactive mode - normally used by just running ghci; see ghci
1224 for details.
1225
1226 --make Build a multi-module Haskell program, automatically figuring out
1227 dependencies. Likely to be much easier, and faster, than using
1228 make; see make-mode for details.
1229
1230 --mk-dll
1231 DLL-creation mode (Windows only)
1232
1233 --numeric-version
1234 display GHC version (numeric only)
1235
1236 --print-libdir
1237 display GHC library directory
1238
1239 --show-iface ⟨file⟩
1240 display the contents of an interface file.
1241
1242 --show-options
1243 display the supported command line options
1244
1245 --supported-extensions
1246 display the supported language extensions
1247
1248 --version
1249 display GHC version
1250
1251 -e ⟨expr⟩
1252 Evaluate expr; see eval-mode for details.
1253
1254 -M generate dependency information suitable for use in a Makefile;
1255 see makefile-dependencies for details.
1256
1257 Individual optimizations
1258 -fasm-shortcutting
1259 Enable shortcutting on assembly. Implied by -O2.
1260
1261 -fblock-layout-cfg
1262 Use the new cfg based block layout algorithm.
1263
1264 -fblock-layout-weightless
1265 Ignore cfg weights for code layout.
1266
1267 -fblock-layout-weights
1268 Sets edge weights used by the new code layout algorithm.
1269
1270 -fcall-arity
1271 Enable call-arity optimisation. Implied by -O.
1272
1273 -fcase-folding
1274 Enable constant folding in case expressions. Implied by -O.
1275
1276 -fcase-merge
1277 Enable case-merging. Implied by -O.
1278
1279 -fcmm-elim-common-blocks
1280 Enable Cmm common block elimination. Implied by -O.
1281
1282 -fcmm-sink
1283 Enable Cmm sinking. Implied by -O.
1284
1285 -fcpr-anal
1286 Turn on CPR analysis in the demand analyser. Implied by -O.
1287
1288 -fcross-module-specialise
1289 Turn on specialisation of overloaded functions imported from
1290 other modules.
1291
1292 -fcse Enable common sub-expression elimination. Implied by -O.
1293
1294 -fdicts-cheap
1295 Make dictionary-valued expressions seem cheap to the optimiser.
1296
1297 -fdicts-strict
1298 Make dictionaries strict
1299
1300 -fdmd-tx-dict-sel
1301 Use a special demand transformer for dictionary selectors.
1302 Always enabled by default.
1303
1304 -fdo-eta-reduction
1305 Enable eta-reduction. Implied by -O.
1306
1307 -fdo-lambda-eta-expansion
1308 Enable lambda eta-expansion. Always enabled by default.
1309
1310 -feager-blackholing
1311 Turn on eager blackholing
1312
1313 -fenable-rewrite-rules
1314 Switch on all rewrite rules (including rules generated by auto‐
1315 matic specialisation of overloaded functions). Implied by -O.
1316
1317 -fexcess-precision
1318 Enable excess intermediate precision
1319
1320 -fexitification
1321 Enables exitification optimisation. Implied by -O.
1322
1323 -fexpose-all-unfoldings
1324 Expose all unfoldings, even for very large or recursive func‐
1325 tions.
1326
1327 -ffloat-in
1328 Turn on the float-in transformation. Implied by -O.
1329
1330 -ffull-laziness
1331 Turn on full laziness (floating bindings outwards). Implied by
1332 -O.
1333
1334 -ffun-to-thunk
1335 Allow worker-wrapper to convert a function closure into a thunk
1336 if the function does not use any of its arguments. Off by
1337 default.
1338
1339 -fignore-asserts
1340 Ignore assertions in the source. Implied by -O.
1341
1342 -fignore-interface-pragmas
1343 Ignore pragmas in interface files. Implied by -O0 only.
1344
1345 -flate-dmd-anal
1346 Run demand analysis again, at the end of the simplification
1347 pipeline
1348
1349 -flate-specialise
1350 Run a late specialisation pass
1351
1352 -fliberate-case
1353 Turn on the liberate-case transformation. Implied by -O2.
1354
1355 -fliberate-case-threshold=⟨n⟩
1356 default: 2000. Set the size threshold for the liberate-case
1357 transformation to ⟨n⟩
1358
1359 -fllvm-pass-vectors-in-regs
1360 Pass vector value in vector registers for function calls
1361
1362 -floopification
1363 Turn saturated self-recursive tail-calls into local jumps in the
1364 generated assembly. Implied by -O.
1365
1366 -fmax-inline-alloc-size=⟨n⟩
1367 default: 128. Set the maximum size of inline array allocations
1368 to ⟨n⟩ bytes (default: 128).
1369
1370 -fmax-inline-memcpy-insns=⟨n⟩
1371 default: 32. Inline memcpy calls if they would generate no more
1372 than ⟨n⟩ pseudo instructions.
1373
1374 -fmax-inline-memset-insns=⟨n⟩
1375 default: 32. Inline memset calls if they would generate no more
1376 than ⟨n⟩ pseudo instructions
1377
1378 -fmax-simplifier-iterations=⟨n⟩
1379 default: 4. Set the max iterations for the simplifier.
1380
1381 -fmax-uncovered-patterns=⟨n⟩
1382 default: 4. Set the maximum number of patterns to display in
1383 warnings about non-exhaustive ones.
1384
1385 -fmax-worker-args=⟨n⟩
1386 default: 10. If a worker has that many arguments, none will be
1387 unpacked anymore.
1388
1389 -fno-opt-coercion
1390 Turn off the coercion optimiser
1391
1392 -fno-pre-inlining
1393 Turn off pre-inlining
1394
1395 -fno-state-hack
1396 Turn off the state hackwhereby any lambda with a real-world
1397 state token as argument is considered to be single-entry. Hence
1398 OK to inline things inside it.
1399
1400 -fomit-interface-pragmas
1401 Don't generate interface pragmas. Implied by -O0 only.
1402
1403 -fomit-yields
1404 Omit heap checks when no allocation is being performed.
1405
1406 -foptimal-applicative-do
1407 Use a slower but better algorithm for ApplicativeDo
1408
1409 -fpedantic-bottoms
1410 Make GHC be more precise about its treatment of bottom (but see
1411 also -fno-state-hack). In particular, GHC will not eta-expand
1412 through a case expression.
1413
1414 -fregs-graph
1415 Use the graph colouring register allocator for register alloca‐
1416 tion in the native code generator. Implied by -O2.
1417
1418 -fregs-iterative
1419 Use the iterative coalescing graph colouring register allocator
1420 in the native code generator.
1421
1422 -fsimpl-tick-factor=⟨n⟩
1423 default: 100. Set the percentage factor for simplifier ticks.
1424
1425 -fsimplifier-phases=⟨n⟩
1426 default: 2. Set the number of phases for the simplifier.
1427 Ignored with -O0.
1428
1429 -fsolve-constant-dicts
1430 When solving constraints, try to eagerly solve super classes
1431 using available dictionaries.
1432
1433 -fspec-constr
1434 Turn on the SpecConstr transformation. Implied by -O2.
1435
1436 -fspec-constr-count=⟨n⟩
1437 default: 3.* Set to ⟨n⟩ the maximum number of specialisations
1438 that will be created for any one function by the SpecConstr
1439 transformation.
1440
1441 -fspec-constr-keen
1442 Specialize a call with an explicit constructor argument, even if
1443 the argument is not scrutinised in the body of the function
1444
1445 -fspec-constr-threshold=⟨n⟩
1446 default: 2000. Set the size threshold for the SpecConstr trans‐
1447 formation to ⟨n⟩.
1448
1449 -fspecialise
1450 Turn on specialisation of overloaded functions. Implied by -O.
1451
1452 -fspecialise-aggressively
1453 Turn on specialisation of overloaded functions regardless of
1454 size, if unfolding is available
1455
1456 -fstatic-argument-transformation
1457 Turn on the static argument transformation.
1458
1459 -fstg-cse
1460 Enable common sub-expression elimination on the STG intermediate
1461 language
1462
1463 -fstg-lift-lams
1464 Enable late lambda lifting on the STG intermediate language.
1465 Implied by -O2.
1466
1467 -fstg-lift-lams-known
1468 Allow turning known into unknown calls while performing late
1469 lambda lifting.
1470
1471 -fstg-lift-lams-non-rec-args
1472 Create top-level non-recursive functions with at most <n> param‐
1473 eters while performing late lambda lifting.
1474
1475 -fstg-lift-lams-rec-args
1476 Create top-level recursive functions with at most <n> parameters
1477 while performing late lambda lifting.
1478
1479 -fstrictness
1480 Turn on strictness analysis. Implied by -O. Implies
1481 -fworker-wrapper
1482
1483 -fstrictness-before=⟨n⟩
1484 Run an additional strictness analysis before simplifier phase
1485 ⟨n⟩
1486
1487 -funbox-small-strict-fields
1488 Flatten strict constructor fields with a pointer-sized represen‐
1489 tation. Implied by -O.
1490
1491 -funbox-strict-fields
1492 Flatten strict constructor fields
1493
1494 -funfolding-creation-threshold=⟨n⟩
1495 default: 750. Tweak unfolding settings.
1496
1497 -funfolding-dict-discount=⟨n⟩
1498 default: 30. Tweak unfolding settings.
1499
1500 -funfolding-fun-discount=⟨n⟩
1501 default: 60. Tweak unfolding settings.
1502
1503 -funfolding-keeness-factor=⟨n⟩
1504 default: 1.5. Tweak unfolding settings.
1505
1506 -funfolding-use-threshold=⟨n⟩
1507 default: 60. Tweak unfolding settings.
1508
1509 Optimization levels
1510 -O Enable level 1 optimisations
1511
1512 -O0 Disable optimisations (default)
1513
1514 -O2 Enable level 2 optimisations
1515
1516 Package options
1517 -clear-package-db
1518 Clear the package db stack.
1519
1520 -distrust ⟨pkg⟩
1521 Expose package ⟨pkg⟩ and set it to be distrusted. See
1522 safe-haskell.
1523
1524 -distrust-all-packages
1525 Distrust all packages by default. See safe-haskell.
1526
1527 -fpackage-trust
1528 Enable Safe Haskell trusted package requirement for trustworthy
1529 modules.
1530
1531 -global-package-db
1532 Add the global package db to the stack.
1533
1534 -hide-all-packages
1535 Hide all packages by default
1536
1537 -hide-package ⟨pkg⟩
1538 Hide package ⟨pkg⟩
1539
1540 -ignore-package ⟨pkg⟩
1541 Ignore package ⟨pkg⟩
1542
1543 -no-auto-link-packages
1544 Don't automatically link in the base and rts packages.
1545
1546 -no-global-package-db
1547 Remove the global package db from the stack.
1548
1549 -no-user-package-db
1550 Remove the user's package db from the stack.
1551
1552 -package ⟨pkg⟩
1553 Expose package ⟨pkg⟩
1554
1555 -package-db ⟨file⟩
1556 Add ⟨file⟩ to the package db stack.
1557
1558 -package-env ⟨file⟩|⟨name⟩
1559 Use the specified package environment.
1560
1561 -package-id ⟨unit-id⟩
1562 Expose package by id ⟨unit-id⟩
1563
1564 -this-unit-id ⟨unit-id⟩
1565 Compile to be part of unit (i.e. package) ⟨unit-id⟩
1566
1567 -trust ⟨pkg⟩
1568 Expose package ⟨pkg⟩ and set it to be trusted. See safe-haskell.
1569
1570 -user-package-db
1571 Add the user's package db to the stack.
1572
1573 Phases of compilation
1574 -C Stop after generating C (.hc file)
1575
1576 -c Stop after generating object (.o) file
1577
1578 -E Stop after preprocessing (.hspp file)
1579
1580 -F Enable the use of a pre-processor (set with -pgmF ⟨cmd⟩)
1581
1582 -S Stop after generating assembly (.s file)
1583
1584 -x ⟨suffix⟩
1585 Override default behaviour for source files
1586
1587 Overriding external programs
1588 -pgma ⟨cmd⟩
1589 Use ⟨cmd⟩ as the assembler
1590
1591 -pgmc ⟨cmd⟩
1592 Use ⟨cmd⟩ as the C compiler
1593
1594 -pgmdll ⟨cmd⟩
1595 Use ⟨cmd⟩ as the DLL generator
1596
1597 -pgmF ⟨cmd⟩
1598 Use ⟨cmd⟩ as the pre-processor (with -F only)
1599
1600 -pgmi ⟨cmd⟩
1601 Use ⟨cmd⟩ as the external interpreter command.
1602
1603 -pgmL ⟨cmd⟩
1604 Use ⟨cmd⟩ as the literate pre-processor
1605
1606 -pgml ⟨cmd⟩
1607 Use ⟨cmd⟩ as the linker
1608
1609 -pgmlc ⟨cmd⟩
1610 Use ⟨cmd⟩ as the LLVM compiler
1611
1612 -pgmlibtool ⟨cmd⟩
1613 Use ⟨cmd⟩ as the command for libtool (with -staticlib only).
1614
1615 -pgmlo ⟨cmd⟩
1616 Use ⟨cmd⟩ as the LLVM optimiser
1617
1618 -pgmP ⟨cmd⟩
1619 Use ⟨cmd⟩ as the C pre-processor (with -cpp only)
1620
1621 -pgms ⟨cmd⟩
1622 Use ⟨cmd⟩ as the splitter
1623
1624 -pgmwindres ⟨cmd⟩
1625 Use ⟨cmd⟩ as the program for embedding manifests on Windows.
1626
1627 Phase-specific options
1628 -opta ⟨option⟩
1629 pass ⟨option⟩ to the assembler
1630
1631 -optc ⟨option⟩
1632 pass ⟨option⟩ to the C compiler
1633
1634 -optdll ⟨option⟩
1635 pass ⟨option⟩ to the DLL generator
1636
1637 -optF ⟨option⟩
1638 pass ⟨option⟩ to the custom pre-processor
1639
1640 -opti ⟨option⟩
1641 pass ⟨option⟩ to the interpreter sub-process.
1642
1643 -optL ⟨option⟩
1644 pass ⟨option⟩ to the literate pre-processor
1645
1646 -optl ⟨option⟩
1647 pass ⟨option⟩ to the linker
1648
1649 -optlc ⟨option⟩
1650 pass ⟨option⟩ to the LLVM compiler
1651
1652 -optlo ⟨option⟩
1653 pass ⟨option⟩ to the LLVM optimiser
1654
1655 -optP ⟨option⟩
1656 pass ⟨option⟩ to cpp (with -cpp only)
1657
1658 -optwindres ⟨option⟩
1659 pass ⟨option⟩ to windres.
1660
1661 Platform-specific options
1662 -msse2 (x86 only) Use SSE2 for floating-point operations
1663
1664 -msse4.2
1665 (x86 only) Use SSE4.2 for floating-point operations
1666
1667 Compiler plugins
1668 -fclear-plugins
1669 Clear the list of active plugins
1670
1671 -fplugin-opt=⟨module⟩:⟨args⟩
1672 Give arguments to a plugin module; module must be specified with
1673 -fplugin=⟨module⟩
1674
1675 -fplugin=⟨module⟩
1676 Load a plugin exported by a given module
1677
1678 -hide-all-plugin-packages
1679 Hide all packages for plugins by default
1680
1681 -plugin-package ⟨pkg⟩
1682 Expose ⟨pkg⟩ for plugins
1683
1684 -plugin-package-id ⟨pkg-id⟩
1685 Expose ⟨pkg-id⟩ for plugins
1686
1687 Profiling
1688 -fno-prof-auto
1689 Disables any previous -fprof-auto, -fprof-auto-top, or
1690 -fprof-auto-exported options.
1691
1692 -fno-prof-cafs
1693 Disables any previous -fprof-cafs option.
1694
1695 -fno-prof-count-entries
1696 Do not collect entry counts
1697
1698 -fprof-auto
1699 Auto-add SCC\ s to all bindings not marked INLINE
1700
1701 -fprof-auto-calls
1702 Auto-add SCC\ s to all call sites
1703
1704 -fprof-auto-exported
1705 Auto-add SCC\ s to all exported bindings not marked INLINE
1706
1707 -fprof-auto-top
1708 Auto-add SCC\ s to all top-level bindings not marked INLINE
1709
1710 -fprof-cafs
1711 Auto-add SCC\ s to all CAFs
1712
1713 -prof Turn on profiling
1714
1715 -ticky Turn on ticky-ticky profiling
1716
1717 Program coverage
1718 -fhpc Turn on Haskell program coverage instrumentation
1719
1720 Recompilation checking
1721 -fforce-recomp
1722 Turn off recompilation checking. This is implied by any -ddump-X
1723 option when compiling a single file (i.e. when using -c).
1724
1725 -fignore-hpc-changes
1726 Do not recompile modules just to match changes to HPC flags.
1727 This is especially useful for avoiding recompilation when using
1728 GHCi, and is enabled by default for GHCi.
1729
1730 -fignore-optim-changes
1731 Do not recompile modules just to match changes to optimisation
1732 flags. This is especially useful for avoiding recompilation when
1733 using GHCi, and is enabled by default for GHCi.
1734
1735 Redirecting output
1736 --exclude-module=⟨file⟩
1737 Regard ⟨file⟩ as "stable"; i.e., exclude it from having depen‐
1738 dencies on it.
1739
1740 -ddump-mod-cycles
1741 Dump module cycles
1742
1743 -dep-makefile ⟨file⟩
1744 Use ⟨file⟩ as the makefile
1745
1746 -dep-suffix ⟨suffix⟩
1747 Make dependencies that declare that files with suffix
1748 .⟨suf⟩⟨osuf⟩ depend on interface files with suffix .⟨suf⟩hi
1749
1750 -dumpdir ⟨dir⟩
1751 redirect dump files
1752
1753 -hcsuf ⟨suffix⟩
1754 set the suffix to use for intermediate C files
1755
1756 -hidir ⟨dir⟩
1757 set directory for interface files
1758
1759 -hiedir ⟨dir⟩
1760 set directory for extended interface files
1761
1762 -hiesuf ⟨suffix⟩
1763 set the suffix to use for extended interface files
1764
1765 -hisuf ⟨suffix⟩
1766 set the suffix to use for interface files
1767
1768 -include-pkg-deps
1769 Regard modules imported from packages as unstable
1770
1771 -o ⟨file⟩
1772 set output filename
1773
1774 -odir ⟨dir⟩
1775 set directory for object files
1776
1777 -ohi ⟨file⟩
1778 set the filename in which to put the interface
1779
1780 -osuf ⟨suffix⟩
1781 set the output file suffix
1782
1783 -outputdir ⟨dir⟩
1784 set output directory
1785
1786 -stubdir ⟨dir⟩
1787 redirect FFI stub files
1788
1789 Temporary files
1790 -tmpdir ⟨dir⟩
1791 set the directory for temporary files
1792
1793 Verbosity options
1794 -fabstract-refinement-hole-fits
1795 default: off. Toggles whether refinements where one or more of
1796 the holes are abstract are reported.
1797
1798 -fdiagnostics-color=⟨always|auto|never⟩
1799 Use colors in error messages
1800
1801 -fdiagnostics-show-caret
1802 Whether to show snippets of original source code
1803
1804 -ferror-spans
1805 Output full span in error messages
1806
1807 -fhide-source-paths
1808 hide module source and object paths
1809
1810 -fmax-refinement-hole-fits=⟨n⟩
1811 default: 6. Set the maximum number of refinement hole fits for
1812 typed holes to display in type error messages.
1813
1814 -fmax-relevant-binds=⟨n⟩
1815 default: 6. Set the maximum number of bindings to display in
1816 type error messages.
1817
1818 -fmax-valid-hole-fits=⟨n⟩
1819 default: 6. Set the maximum number of valid hole fits for typed
1820 holes to display in type error messages.
1821
1822 -fno-show-valid-hole-fits
1823 Disables showing a list of valid hole fits for typed holes in
1824 type error messages.
1825
1826 -fno-sort-valid-hole-fits
1827 Disables the sorting of the list of valid hole fits for typed
1828 holes in type error messages.
1829
1830 -fprint-equality-relations
1831 Distinguish between equality relations when printing
1832
1833 -fprint-expanded-synonyms
1834 In type errors, also print type-synonym-expanded types.
1835
1836 -fprint-explicit-coercions
1837 Print coercions in types
1838
1839 -fprint-explicit-foralls
1840 Print explicit forall quantification in types. See also -XEx‐
1841 plicitForAll
1842
1843 -fprint-explicit-kinds
1844 Print explicit kind foralls and kind arguments in types. See
1845 also -XKindSignatures
1846
1847 -fprint-explicit-runtime-reps
1848 Print RuntimeRep variables in types which are runtime-represen‐
1849 tation polymorphic.
1850
1851 -fprint-explicit-runtime-reps
1852 Print RuntimeRep variables in types which are runtime-represen‐
1853 tation polymorphic.
1854
1855 -fprint-potential-instances
1856 display all available instances in type error messages
1857
1858 -fprint-typechecker-elaboration
1859 Print extra information from typechecker.
1860
1861 -fprint-unicode-syntax
1862 Use unicode syntax when printing expressions, types and kinds.
1863 See also -XUnicodeSyntax
1864
1865 -frefinement-level-hole-fits=⟨n⟩
1866 default: off. Sets the level of refinement of the refinement
1867 hole fits, where level n means that hole fits of up to n holes
1868 will be considered.
1869
1870 -freverse-errors
1871 Output errors in reverse order
1872
1873 -fshow-docs-of-hole-fits
1874 Toggles whether to show the documentation of the valid hole fits
1875 in the output.
1876
1877 -fshow-hole-constraints
1878 Show constraints when reporting typed holes.
1879
1880 -fshow-hole-matches-of-hole-fits
1881 Toggles whether to show the type of the additional holes in
1882 refinement hole fits.
1883
1884 -fshow-provenance-of-hole-fits
1885 Toggles whether to show the provenance of the valid hole fits in
1886 the output.
1887
1888 -fshow-type-app-of-hole-fits
1889 Toggles whether to show the type application of the valid hole
1890 fits in the output.
1891
1892 -fshow-type-app-vars-of-hole-fits
1893 Toggles whether to show what type each quantified variable takes
1894 in a valid hole fit.
1895
1896 -fshow-type-of-hole-fits
1897 Toggles whether to show the type of the valid hole fits in the
1898 output.
1899
1900 -funclutter-valid-hole-fits
1901 Unclutter the list of valid hole fits by not showing provenance
1902 nor type applications of suggestions.
1903
1904 -Rghc-timing
1905 Summarise timing stats for GHC (same as +RTS -tstderr).
1906
1907 -v verbose mode (equivalent to -v3)
1908
1909 -v⟨n⟩ set verbosity level
1910
1911 Warnings
1912 -fdefer-out-of-scope-variables
1913 Convert variable out of scope variables errors into warnings.
1914 Implied by -fdefer-type-errors. See also -Wde‐
1915 ferred-out-of-scope-variables.
1916
1917 -fdefer-type-errors
1918 Turn type errors into warnings, deferring the error until run‐
1919 time. Implies -fdefer-typed-holes and -fdefer-out-of-scope-vari‐
1920 ables. See also -Wdeferred-type-errors
1921
1922 -fdefer-typed-holes
1923 Convert typed hole errors into warnings, deferring the error
1924 until runtime. Implied by -fdefer-type-errors. See also
1925 -Wtyped-holes.
1926
1927 -fhelpful-errors
1928 Make suggestions for mis-spelled names.
1929
1930 -fmax-pmcheck-iterations=⟨n⟩
1931 the iteration limit for the pattern match checker
1932
1933 -fshow-warning-groups
1934 show which group an emitted warning belongs to.
1935
1936 -W enable normal warnings
1937
1938 -w disable all warnings
1939
1940 -Wall enable almost all warnings (details in options-sanity)
1941
1942 -Wall-missed-specialisations
1943 warn when specialisation of any overloaded function fails.
1944
1945 -Wcompat
1946 enable future compatibility warnings (details in options-sanity)
1947
1948 -Wcpp-undef
1949 warn on uses of the #if directive on undefined identifiers
1950
1951 -Wdeferred-out-of-scope-variables
1952 Report warnings when variable out-of-scope errors are deferred
1953 until runtime. See -fdefer-out-of-scope-variables.
1954
1955 -Wdeferred-type-errors
1956 Report warnings when deferred type errors are enabled. This
1957 option is enabled by default. See -fdefer-type-errors.
1958
1959 -Wdeprecated-flags
1960 warn about uses of commandline flags that are deprecated
1961
1962 -Wdeprecations
1963 warn about uses of functions & types that have warnings or dep‐
1964 recated pragmas. Alias for -Wwarnings-deprecations
1965
1966 -Wdodgy-exports
1967 warn about dodgy exports
1968
1969 -Wdodgy-foreign-imports
1970 warn about dodgy foreign imports
1971
1972 -Wdodgy-imports
1973 warn about dodgy imports
1974
1975 -Wduplicate-constraints
1976 warn when a constraint appears duplicated in a type signature
1977
1978 -Wduplicate-exports
1979 warn when an entity is exported multiple times
1980
1981 -Wempty-enumerations
1982 warn about enumerations that are empty
1983
1984 -Werror
1985 make warnings fatal
1986
1987 -Weverything
1988 enable all warnings supported by GHC
1989
1990 -Whi-shadowing
1991 warn when a .hi file in the current directory shadows a library
1992
1993 -Widentities
1994 warn about uses of Prelude numeric conversions that are probably
1995 the identity (and hence could be omitted)
1996
1997 -Wimplicit-kind-vars
1998 warn when kind variables are brought into scope implicitly
1999 despite the "forall-or-nothing" rule
2000
2001 -Wimplicit-prelude
2002 warn when the Prelude is implicitly imported
2003
2004 -Winaccessible-code
2005 warn about inaccessible code
2006
2007 -Wincomplete-patterns
2008 warn when a pattern match could fail
2009
2010 -Wincomplete-record-updates
2011 warn when a record update could fail
2012
2013 -Wincomplete-uni-patterns
2014 warn when a pattern match in a lambda expression or pattern
2015 binding could fail
2016
2017 -Winline-rule-shadowing
2018 Warn if a rewrite RULE might fail to fire because the function
2019 might be inlined before the rule has a chance to fire. See
2020 rules-inline.
2021
2022 -Wmissed-extra-shared-lib
2023 Warn when GHCi can't load a shared lib.
2024
2025 -Wmissed-specialisations
2026 warn when specialisation of an imported, overloaded function
2027 fails.
2028
2029 -Wmissing-deriving-strategies
2030 warn when a deriving clause is missing a deriving strategy
2031
2032 -Wmissing-export-lists
2033 warn when a module declaration does not explicitly list all
2034 exports
2035
2036 -Wmissing-exported-signatures
2037 warn about top-level functions without signatures, only if they
2038 are exported. takes precedence over -Wmissing-signatures
2039
2040 -Wmissing-exported-sigs
2041 (deprecated) warn about top-level functions without signatures,
2042 only if they are exported. takes precedence over -Wmissing-sig‐
2043 natures
2044
2045 -Wmissing-fields
2046 warn when fields of a record are uninitialised
2047
2048 -Wmissing-home-modules
2049 warn when encountering a home module imported, but not listed on
2050 the command line. Useful for cabal to ensure GHC won't pick up
2051 modules, not listed neither in exposed-modules, nor in
2052 other-modules.
2053
2054 -Wmissing-import-lists
2055 warn when an import declaration does not explicitly list all the
2056 names brought into scope
2057
2058 -Wmissing-local-signatures
2059 warn about polymorphic local bindings without signatures
2060
2061 -Wmissing-local-sigs
2062 (deprecated) warn about polymorphic local bindings without sig‐
2063 natures
2064
2065 -Wmissing-methods
2066 warn when class methods are undefined
2067
2068 -Wmissing-monadfail-instances
2069 Warn when a failable pattern is used in a do-block that does not
2070 have a MonadFail instance.
2071
2072 -Wmissing-pattern-synonym-signatures
2073 warn when pattern synonyms do not have type signatures
2074
2075 -Wmissing-signatures
2076 warn about top-level functions without signatures
2077
2078 -Wmonomorphism-restriction
2079 warn when the Monomorphism Restriction is applied
2080
2081 -Wname-shadowing
2082 warn when names are shadowed
2083
2084 -Wno-compat
2085 Disables all warnings enabled by -Wcompat.
2086
2087 -Wnoncanonical-monad-instances
2088 warn when Applicative or Monad instances have noncanonical defi‐
2089 nitions of return, pure, (>>), or (*>). See flag description in
2090 options-sanity for more details.
2091
2092 -Wnoncanonical-monadfail-instances
2093 warn when Monad or MonadFail instances have noncanonical defini‐
2094 tions of fail. See flag description in options-sanity for more
2095 details.
2096
2097 -Wnoncanonical-monoid-instances
2098 warn when Semigroup or Monoid instances have noncanonical defi‐
2099 nitions of (<>) or mappend. See flag description in
2100 options-sanity for more details.
2101
2102 -Worphans
2103 warn when the module contains orphan instance declarations or
2104 rewrite rules
2105
2106 -Woverflowed-literals
2107 warn about literals that will overflow their type
2108
2109 -Woverlapping-patterns
2110 warn about overlapping patterns
2111
2112 -Wpartial-fields
2113 warn when defining a partial record field.
2114
2115 -Wpartial-type-signatures
2116 warn about holes in partial type signatures when -XPartialTypeS‐
2117 ignatures is enabled. Not applicable when -XPartialTypesigna‐
2118 tures is not enabled, in which case errors are generated for
2119 such holes. See partial-type-signatures.
2120
2121 -Wredundant-constraints
2122 Have the compiler warn about redundant constraints in type sig‐
2123 natures.
2124
2125 -Wsafe warn if the module being compiled is regarded to be safe.
2126
2127 -Wsemigroup
2128 warn when a Monoid is not Semigroup, and on non- Semigroup defi‐
2129 nitions of (<>)?
2130
2131 -Wsimplifiable-class-constraints
2132 Warn about class constraints in a type signature that can be
2133 simplified using a top-level instance declaration.
2134
2135 -Wspace-after-bang
2136 warn for missing space before the second argument of an infix
2137 definition of (!) when -XBangPatterns are not enabled
2138
2139 -Wstar-binder
2140 warn about binding the (*) type operator despite -XStarIsType
2141
2142 -Wstar-is-type
2143 warn when * is used to mean Data.Kind.Type
2144
2145 -Wtabs warn if there are tabs in the source file
2146
2147 -Wtrustworthy-safe
2148 warn if the module being compiled is marked as Trustworthy but
2149 it could instead be marked as Safe, a more informative bound.
2150
2151 -Wtype-defaults
2152 warn when defaulting happens
2153
2154 -Wtyped-holes
2155 Report warnings when typed hole errors are deferred until run‐
2156 time. See -fdefer-typed-holes.
2157
2158 -Wunbanged-strict-patterns
2159 warn on pattern bind of unlifted variable that is neither bare
2160 nor banged
2161
2162 -Wunrecognised-pragmas
2163 warn about uses of pragmas that GHC doesn't recognise
2164
2165 -Wunrecognised-warning-flags
2166 throw a warning when an unreconised -W... flag is encountered on
2167 the command line.
2168
2169 -Wunsafe
2170 warn if the module being compiled is regarded to be unsafe. See
2171 safe-haskell
2172
2173 -Wunsupported-calling-conventions
2174 warn about use of an unsupported calling convention
2175
2176 -Wunsupported-llvm-version
2177 Warn when using -fllvm with an unsupported version of LLVM.
2178
2179 -Wunticked-promoted-constructors
2180 warn if promoted constructors are not ticked
2181
2182 -Wunused-binds
2183 warn about bindings that are unused. Alias for
2184 -Wunused-top-binds, -Wunused-local-binds and -Wunused-pat‐
2185 tern-binds
2186
2187 -Wunused-do-bind
2188 warn about do bindings that appear to throw away values of types
2189 other than ()
2190
2191 -Wunused-foralls
2192 warn about type variables in user-written forall\s that are
2193 unused
2194
2195 -Wunused-imports
2196 warn about unnecessary imports
2197
2198 -Wunused-local-binds
2199 warn about local bindings that are unused
2200
2201 -Wunused-matches
2202 warn about variables in patterns that aren't used
2203
2204 -Wunused-pattern-binds
2205 warn about pattern match bindings that are unused
2206
2207 -Wunused-top-binds
2208 warn about top-level bindings that are unused
2209
2210 -Wunused-type-patterns
2211 warn about unused type variables which arise from patterns in in
2212 type family and data family instances
2213
2214 -Wwarn make warnings non-fatal
2215
2216 -Wwarnings-deprecations
2217 warn about uses of functions & types that have warnings or dep‐
2218 recated pragmas
2219
2220 -Wwrong-do-bind
2221 warn about do bindings that appear to throw away monadic values
2222 that you should have bound instead
2223
2225 Copyright 2015. The University Court of the University of Glasgow. All
2226 rights reserved.
2227
2229 The GHC Team
2230
2232 2020, GHC Team
2233
2234
2235
2236
22378.8.4 Jul 27, 2020 GHC(1)