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