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