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