GHC(1)
okay so bestie, this is the GHC(1) manual page from the Glasgow Haskell Compiler docs. I'm gonna give you the whole thing with main-character energy, but every single flag and fact stays exactly where it belongs. 💅✨
💖 NAME 💖
ghc — the Glasgow Haskell Compiler. That's it, that's the name, iconic. 👑
🐚 SYNOPSIS 🐚
ghc [option|filename]
ghci [option|filename]
📖 DESCRIPTION 📖
This manual page documents briefly the ghc and ghci commands. Note that ghci is not yet available on all architectures. Extensive documentation is available in various other formats including PDF <https://downloads.haskell.org/ghc/latest/docs/users_guide.pdf> and HTML <https://downloads.haskell.org/ghc/latest/docs/html/>.
Each of GHC's command line options is classified as either static or dynamic. A static flag may only be specified on the command line, whereas a dynamic flag may also be given in an OPTIONS pragma in a source file or set from the GHCi command-line with :set.
As a rule of thumb, all the language options are dynamic, as are the warning options and the debugging options.
The rest are static, with the notable exceptions of -v, -cpp, -fasm, -fvia-C, -fllvm, and -#include. The OPTIONS section lists the status of each flag.
Common suffixes of file names for Haskell are:
.hs— Haskell source code; preprocess, compile.lhs— literate Haskell source; unlit, preprocess, compile.hi— Interface file; contains information about exported symbols.hc— intermediate C files.⟨way⟩_o— object files for "way" ⟨way⟩; common ways are:dyn— dynamically-linkedp— built with profiling
.⟨way⟩_hi— interface files for "way" ⟨way⟩; common ways are:
✨ OPTIONS ✨
Now the big one, bestie. Every flag is here, grouped exactly like the original. Some flags show up more than once because the original did that — I'm not merging them, periodt. 🫶
💻 Code generation 💻
-dynamic-too— code generation flag.-fasm— code generation flag.-fllvm— code generation flag.-fbyte-code— code generation flag.-fbyte-code-and-object-code— code generation flag.-fexpose-internal-symbols— code generation flag.-fexternal-dynamic-refs— code generation flag.-fllvm— code generation flag (listed again, fr).-fasm— code generation flag (listed again, fr).-fno-code— code generation flag.-fobject-code— code generation flag.-fPIC— code generation flag.-fPIE— code generation flag.-fprefer-byte-code— code generation flag.-fwrite-if-simplified-core— code generation flag.-fwrite-interface— code generation flag.-split-objs— code generation flag.
🐞 Debugging the compiler 🐞
-dasm-lint— debug flag.-dcmm-lint— debug flag.-dcore-lint— debug flag.-ddisable-js-minifier— debug flag.-ddump-asm— debug flag.-ddump-asm-conflicts— debug flag.-ddump-asm-liveness— debug flag.-ddump-asm-native— debug flag.-ddump-asm-regalloc— debug flag.-ddump-asm-regalloc-stages— debug flag.-ddump-asm-stats— debug flag.-ddump-bcos— debug flag.-ddump-c-backend— debug flag.-ddump-call-arity— debug flag.-ddump-cfg-weights— debug flag.-ddump-cmm— debug flag.-ddump-cmm-caf— debug flag.-ddump-cmm-cbe— debug flag.-ddump-cmm-cfg— debug flag.-ddump-cmm-cps— debug flag.-ddump-cmm-from-stg— debug flag.-ddump-cmm-info— debug flag.-ddump-cmm-opt— debug flag.-ddump-cmm-proc— debug flag.-ddump-cmm-procmap— debug flag.-ddump-cmm-raw— debug flag.-ddump-cmm-sink— debug flag.-ddump-cmm-sp— debug flag.-ddump-cmm-split— debug flag.-ddump-cmm-switch— debug flag.-ddump-cmm-thread-sanitizer— debug flag.-ddump-cmm-verbose— debug flag.-ddump-cmm-verbose-by-proc— debug flag.-ddump-core-stats— debug flag.-ddump-cpr-signatures— debug flag.-ddump-cpranal— debug flag.-ddump-cs-trace— debug flag.-ddump-cse— debug flag.-ddump-debug— debug flag.-ddump-deriv— debug flag.-ddump-ds— debug flag.-ddump-ds-preopt— debug flag.-ddump-ec-trace— debug flag.-ddump-exitify— debug flag.-ddump-faststrings— debug flag.-ddump-file-prefix=⟨str⟩— debug flag.-ddump-float-in— debug flag.-ddump-foreign— debug flag.-ddump-full-laziness— debug flag.-ddump-float-out— debug flag.-ddump-hie— debug flag.-ddump-hpc— debug flag.-ddump-if-trace— debug flag.-ddump-inlinings— debug flag.-ddump-js— debug flag.-ddump-json— debug flag.-ddump-late-cc— debug flag.-ddump-liberate-case— debug flag.-ddump-llvm— debug flag.-ddump-mod-map— debug flag.-ddump-occur-anal— debug flag.-ddump-opt-cmm— debug flag.-ddump-parsed— debug flag.-ddump-parsed-ast— debug flag.-ddump-prep— debug flag.-ddump-rn— debug flag.-ddump-rn-ast— debug flag.-ddump-rn-stats— debug flag.-ddump-rn-trace— debug flag.-ddump-rtti— debug flag.-ddump-rule-firings— debug flag.-ddump-rule-rewrites— debug flag.-ddump-rules— debug flag.-ddump-simpl— debug flag.-ddump-simpl-iterations— debug flag.-ddump-simpl-stats— debug flag.-ddump-simpl-trace— debug flag.-ddump-spec— debug flag.-ddump-spec-constr— debug flag.-ddump-splices— debug flag.-ddump-static-argument-transformation— debug flag.-ddump-stg— debug flag.-ddump-stg-cg— debug flag.-ddump-stg-final— debug flag.-ddump-stg-from-core— debug flag.-ddump-stg-tags— debug flag.-ddump-stg-unarised— debug flag.-ddump-str-signatures— debug flag.-ddump-stranal— debug flag.-ddump-tc— debug flag.-ddump-tc-ast— debug flag.-ddump-tc-trace— debug flag.-ddump-ticked— debug flag.-ddump-timings— debug flag.-ddump-to-file— debug flag.-ddump-types— debug flag.-ddump-verbose-inlinings— debug flag.-ddump-view-pattern-commoning— debug flag.-ddump-worker-wrapper— debug flag.-dfaststring-stats— debug flag.-dhex-word-literals— debug flag.-dinitial-unique=⟨s⟩— debug flag.-dinline-check=⟨str⟩— debug flag.-dipe-stats— debug flag.-dkeep-comments— debug flag.-dlinear-core-lint— debug flag.-dlint— debug flag.-dno-debug-output— debug flag.-ddebug-output— debug flag.-dno-typeable-binds— debug flag.-dppr-case-as-let— debug flag.-dppr-cols=⟨n⟩— debug flag.-dppr-debug— debug flag.-dppr-user-length— debug flag.-drule-check=⟨str⟩— debug flag.-dshow-passes— debug flag.-dstg-lint— debug flag.-dsuppress-all— debug flag.-dsuppress-coercion-types— debug flag.-dsuppress-coercions— debug flag.-dsuppress-core-sizes— debug flag.-dsuppress-idinfo— debug flag.-dsuppress-module-prefixes— debug flag.-dsuppress-stg-free-vars— debug flag.-dsuppress-stg-reps— debug flag.-dsuppress-ticks— debug flag.-dsuppress-timestamps— debug flag.-dsuppress-type-applications— debug flag.-dsuppress-type-signatures— debug flag.-dsuppress-unfoldings— debug flag.-dsuppress-uniques— debug flag.-dsuppress-var-kinds— debug flag.-dtag-inference-checks— debug flag.-dth-dec-file— debug flag.-dunique-increment=⟨i⟩— debug flag.-dverbose-core2core— debug flag.-dverbose-stg2stg— debug flag.-falignment-sanitisation— debug flag.-fcatch-nonexhaustive-cases— debug flag.-fcheck-prim-bounds— debug flag.-fcmm-thread-sanitizer— debug flag.-fdistinct-constructor-tables— debug flag.-fdump-with-ways— debug flag.-finfo-table-map— debug flag.-finfo-table-map-with-fallback— debug flag.-fno-info-table-map-with-fallback— debug flag.-finfo-table-map-with-stack— debug flag.-fno-info-table-map-with-stack— debug flag.-fllvm-fill-undef-with-garbage— debug flag.-fno-info-table-map-with-fallback— debug flag (listed again).-finfo-table-map-with-fallback— debug flag (listed again).-fno-info-table-map-with-stack— debug flag (listed again).-finfo-table-map-with-stack— debug flag (listed again).-fproc-alignment— debug flag.-funoptimized-core-for-interpreter— debug flag.-fno-unoptimized-core-for-interpreter— debug flag.-g— debug flag.-g⟨n⟩— debug flag.
🧪 C pre-processor 🧪
-cpp— C pre-processor flag.-D⟨symbol⟩[=⟨value⟩]— C pre-processor flag.-U⟨symbol⟩— C pre-processor flag.-I⟨dir⟩— C pre-processor flag.-U⟨symbol⟩— C pre-processor flag (listed again).
🔍 Finding imports 🔍
-i— finding imports flag.-i⟨dir⟩[:⟨dir⟩]*— finding imports flag.
🎮 Interactive mode 🎮
-fbreak-on-error— interactive mode flag.-fno-break-on-error— interactive mode flag.-fbreak-on-exception— interactive mode flag.-fno-break-on-exception— interactive mode flag.-fbreak-points— interactive mode flag.-fno-break-points— interactive mode flag.-fghci-hist-size=⟨n⟩— interactive mode flag.-fghci-leak-check— interactive mode flag.-fno-ghci-leak-check— interactive mode flag.-fimplicit-import-qualified— interactive mode flag.-fno-implicit-import-qualified— interactive mode flag.-flocal-ghci-history— interactive mode flag.-fno-local-ghci-history— interactive mode flag.-fno-it— interactive mode flag.-fno-no-it— interactive mode flag.-fprint-bind-result— interactive mode flag.-fno-print-bind-result— interactive mode flag.-fprint-evld-with-show— interactive mode flag.-fshow-loaded-modules— interactive mode flag.-ghci-script— interactive mode flag.-ignore-dot-ghci— interactive mode flag.-no-ignore-dot-ghci— interactive mode flag.-interactive-print ⟨name⟩— interactive mode flag.
📁 Interface files 📁
--show-iface ⟨file⟩— interface files flag.-ddump-hi— interface files flag.-ddump-hi-diffs— interface files flag.-ddump-minimal-imports— interface files flag.
🧹 Keeping intermediate files 🧹
-keep-hc-file— keeping intermediate files flag.-keep-hc-files— keeping intermediate files flag.-keep-hi-files— keeping intermediate files flag.-no-keep-hi-files— keeping intermediate files flag.-keep-hscpp-file— keeping intermediate files flag.-keep-hscpp-files— keeping intermediate files flag.-keep-llvm-file— keeping intermediate files flag.-keep-llvm-files— keeping intermediate files flag.-keep-o-files— keeping intermediate files flag.-no-keep-o-files— keeping intermediate files flag.-keep-s-file— keeping intermediate files flag.-keep-s-files— keeping intermediate files flag.-keep-tmp-files— keeping intermediate files flag.
🗣️ Language options 🗣️
-XAllowAmbiguousTypes— language option.-XApplicativeDo— language option.-XArrows— language option.-XBangPatterns— language option.-XBinaryLiterals— language option.-XBlockArguments— language option.-XCApiFFI— language option.-XConstrainedClassMethods— language option.-XConstraintKinds— language option.-XCPP— language option.-XCUSKs— language option.-XDataKinds— language option.-XDatatypeContexts— language option.-XDeepSubsumption— language option.-XDefaultSignatures— language option.-XDeriveAnyClass— language option.-XDeriveDataTypeable— language option.-XDeriveFoldable— language option.-XDeriveFunctor— language option.-XDeriveGeneric— language option.-XDeriveLift— language option.-XDeriveTraversable— language option.-XDerivingStrategies— language option.-XDerivingVia— language option.-XDisambiguateRecordFields— language option.-XDuplicateRecordFields— language option.-XEmptyCase— language option.-XEmptyDataDecls— language option.-XEmptyDataDeriving— language option.-XExistentialQuantification— language option.-XExplicitForAll— language option.-XExplicitNamespaces— language option.-XExtendedDefaultRules— language option.-XExtendedLiterals— language option.-XFieldSelectors— language option.-XFlexibleContexts— language option.-XFlexibleInstances— language option.-XForeignFunctionInterface— language option.-XFunctionalDependencies— language option.-XGADTs— language option.-XGADTSyntax— language option.-XGeneralisedNewtypeDeriving— language option.-XGeneralizedNewtypeDeriving— language option.-XGHC2021— language option.-XGHCForeignImportPrim— language option.-XHaskell2010— language option.-XHaskell98— language option.-XHexFloatLiterals— language option.-XImplicitParams— language option.-XImportQualifiedPost— language option.-XImpredicativeTypes— language option.-XIncoherentInstances— language option.-XInstanceSigs— language option.-XInterruptibleFFI— language option.-XKindSignatures— language option.-XLambdaCase— language option.-XLexicalNegation— language option.-XLiberalTypeSynonyms— language option.-XLinearTypes— language option.-XMagicHash— language option.-XMonadComprehensions— language option.-XMonoLocalBinds— language option.-XMultiParamTypeClasses— language option.-XMultiWayIf— language option.-XNamedFieldPuns— language option.-XNamedWildCards— language option.-XNegativeLiterals— language option.-XNoImplicitPrelude— language option.-XNoMonomorphismRestriction— language option.-XNondecreasingIndentation— language option.-XNoPatternGuards— language option.-XNoTraditionalRecordSyntax— language option.-XNPlusKPatterns— language option.-XNullaryTypeClasses— language option.-XNumDecimals— language option.-XNumericUnderscores— language option.-XOverlappingInstances— language option.-XOverloadedLabels— language option.-XOverloadedLists— language option.-XOverloadedRecordDot— language option.-XOverloadedRecordUpdate— language option.-XOverloadedStrings— language option.-XPackageImports— language option.-XParallelListComp— language option.-XPartialTypeSignatures— language option.-XPatternSynonyms— language option.-XPolyKinds— language option.-XPostfixOperators— language option.-XQualifiedDo— language option.-XQuantifiedConstraints— language option.-XQuasiQuotes— language option.-XRank2Types— language option.-XRankNTypes— language option.-XRebindableSyntax— language option.-XRecordWildCards— language option.-XRecursiveDo— language option.-XRoleAnnotations— language option.-XSafe— language option.-XScopedTypeVariables— language option.-XStandaloneDeriving— language option.-XStandaloneKindSignatures— language option.-XStarIsType— language option.-XStaticPointers— language option.-XStrict— language option.-XStrictData— language option.-XTemplateHaskell— language option.-XTemplateHaskellQuotes— language option.-XTransformListComp— language option.-XTrustworthy— language option.-XTupleSections— language option.-XTypeAbstractions— language option.-XTypeApplications— language option.-XTypeData— language option.-XTypeFamilies— language option.-XTypeFamilyDependencies— language option.-XTypeInType— language option.-XTypeOperators— language option.-XTypeSynonymInstances— language option.-XUnboxedSums— language option.-XUnboxedTuples— language option.-XUndecidableInstances— language option.-XUndecidableSuperClasses— language option.-XUnicodeSyntax— language option.-XUnliftedDatatypes— language option.-XUnliftedFFITypes— language option.-XUnliftedNewtypes— language option.-XUnsafe— language option.-XViewPatterns— language option.
🔗 Linking options 🔗
-c— linking flag.-debug— linking flag.-dylib-install-name ⟨path⟩— linking flag.-dynamic— linking flag.-dynload— linking flag.-eventlog— linking flag.-fcompact-unwind— linking flag.-fkeep-cafs— linking flag.-flink-rts— linking flag.-fno-embed-manifest— linking flag.-fno-gen-manifest— linking flag.-fno-shared-implib— linking flag.-framework ⟨name⟩— linking flag.-framework-path ⟨dir⟩— linking flag.-fsplit-sections— linking flag.-split-sections— linking flag.-fno-split-sections— linking flag.-fuse-rpaths— linking flag.-fwhole-archive-hs-libs— linking flag.-L ⟨dir⟩— linking flag.-l ⟨lib⟩— linking flag.-main-is ⟨thing⟩— linking flag.-no-hs-main— linking flag.-no-pie— linking flag.-pie— linking flag.-no-rtsopts-suggestions— linking flag.-package ⟨name⟩— linking flag.-pie— linking flag (listed again).-no-pie— linking flag (listed again).-rdynamic— linking flag.-rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]— linking flag.-shared— linking flag.-single-threaded— linking flag.-threaded— linking flag.-static— linking flag.-staticlib— linking flag.-threaded— linking flag (listed again).-single-threaded— linking flag (listed again).-with-rtsopts=⟨opts⟩— linking flag.
🧃 Miscellaneous options 🧃
-ddump-mod-cycles— miscellaneous flag.-fdefer-out-of-scope-variables— miscellaneous flag.-fno-defer-out-of-scope-variables— miscellaneous flag.-fdefer-type-errors— miscellaneous flag.-fno-defer-type-errors— miscellaneous flag.-fdefer-typed-holes— miscellaneous flag.-fno-defer-typed-holes— miscellaneous flag.-fexternal-interpreter— miscellaneous flag.-ffamily-application-cache— miscellaneous flag.-fno-family-application-cache— miscellaneous flag.-fglasgow-exts— miscellaneous flag.-fno-glasgow-exts— miscellaneous flag.-fno-safe-haskell— miscellaneous flag.-ghcversion-file ⟨path to ghcversion.h⟩— miscellaneous flag.-H ⟨size⟩— miscellaneous flag.-hidden-module ⟨module name⟩— miscellaneous flag.-j[⟨n⟩]— miscellaneous flag.-jsem— miscellaneous flag.-reexported-module ⟨module name⟩— miscellaneous flag.-this-package-name ⟨unit-id⟩— miscellaneous flag.-unit @⟨filename⟩— miscellaneous flag.-working-dir ⟨dir⟩— miscellaneous flag.
🎀 Modes of operation 🎀
okay bestie, before GHC does literally anything it needs to know what mood you're in — compiling? showing info? running a script? Here's the whole "what are we even doing today" squad:
--frontend⟨module⟩--help-?--info--interactive--make--numeric-version--print-booter-version--print-build-platform--print-c-compiler-flags--print-c-compiler-link-flags--print-debug-on--print-global-package-db--print-have-interpreter--print-have-native-code-generator--print-host-platform--print-ld-flags--print-leading-underscore--print-libdir--print-object-splitting-supported--print-project-git-commit-id--print-project-version--print-rts-ways--print-stage--print-support-smp--print-tables-next-to-code--print-target-platform--print-unregisterised--run⟨file⟩--show-iface⟨file⟩--show-options--supported-extensions--supported-languages--version-V-e⟨expr⟩-M-shared
🌸 Individual optimizations 🌸
bestie this is the main character section. it's giving "I have 140 knobs and I'm not afraid to turn them". every one of these has an on/off twin — the -fno- version is literally just the off switch for the one right before it. no cap:
-fasm-shortcutting-fno-asm-shortcutting-fbinary-blob-threshold=⟨n⟩-fblock-layout-cfg-fno-block-layout-cfg-fblock-layout-weightless-fno-block-layout-weightless-fblock-layout-weights-fcall-arity-fno-call-arity-fcase-folding-fno-case-folding-fcase-merge-fno-case-merge-fcmm-control-flow-fno-cmm-control-flow-fcmm-elim-common-blocks-fno-cmm-elim-common-blocks-fcmm-sink-fno-cmm-sink-fcmm-static-pred-fno-cmm-static-pred-fcore-constant-folding-fno-core-constant-folding-fcpr-anal-fno-cpr-anal-fcross-module-specialise-fno-cross-module-specialise-fcse-fno-cse-fdicts-cheap-fno-dicts-cheap-fdicts-strict-fno-dicts-strict-fdmd-tx-dict-sel-fno-dmd-tx-dict-sel-fdmd-unbox-width=⟨n⟩-fdo-eta-reduction-fno-do-eta-reduction-fdo-lambda-eta-expansion-fno-do-lambda-eta-expansion-feager-blackholing-fenable-rewrite-rules-fno-enable-rewrite-rules-fexcess-precision-fno-excess-precision-fexitification-fno-exitification-fexpose-all-unfoldings-fno-expose-all-unfoldings-ffloat-in-fno-float-in-ffull-laziness-fno-full-laziness-ffun-to-thunk-fno-fun-to-thunk-fignore-asserts-fno-ignore-asserts-fignore-interface-pragmas-fno-ignore-interface-pragmas-finline-generics-fno-inline-generics-finline-generics-aggressively-fno-inline-generics-aggressively-flate-dmd-anal-fno-late-dmd-anal-flate-specialise-fno-late-specialise-fliberate-case-fno-liberate-case-fliberate-case-threshold=⟨n⟩-fno-liberate-case-threshold-fllvm-pass-vectors-in-regs-flocal-float-out-fno-local-float-out-flocal-float-out-top-level-fno-local-float-out-top-level-floopification-fno-loopification-fmax-inline-alloc-size=⟨n⟩-fmax-inline-memcpy-insns=⟨n⟩-fmax-inline-memset-insns=⟨n⟩-fmax-simplifier-iterations=⟨n⟩-fmax-uncovered-patterns=⟨n⟩-fmax-worker-args=⟨n⟩-fno-opt-coercion-fno-pre-inlining-fno-state-hack-fomit-interface-pragmas-fno-omit-interface-pragmas-fomit-yields-fno-omit-yields-foptimal-applicative-do-fno-optimal-applicative-do-fpedantic-bottoms-fno-pedantic-bottoms-fpolymorphic-specialisation-fno-polymorphic-specialisation-fregs-graph-fno-regs-graph-fregs-iterative-fno-regs-iterative-fsimpl-tick-factor=⟨n⟩-fsimplifier-phases=⟨n⟩-fsolve-constant-dicts-fno-solve-constant-dicts-fspec-constr-fno-spec-constr-fspec-constr-count=⟨n⟩-fno-spec-constr-count-fspec-constr-keen-fno-spec-constr-keen-fspec-constr-threshold=⟨n⟩-fno-spec-constr-threshold-fspecialise-fno-specialise-fspecialise-aggressively-fno-specialise-aggressively-fspecialise-incoherents-fno-specialise-incoherents-fstatic-argument-transformation-fno-static-argument-transformation-fstg-cse-fno-stg-cse-fstg-lift-lams-fno-stg-lift-lams-fstg-lift-lams-known-fno-stg-lift-lams-known-fstg-lift-lams-non-rec-args-fstg-lift-lams-non-rec-args-any-fstg-lift-lams-rec-args-fstg-lift-lams-rec-args-any-fstrictness-fno-strictness-fstrictness-before=⟨n⟩-funbox-small-strict-fields-fno-unbox-small-strict-fields-funbox-strict-fields-fno-unbox-strict-fields-funfolding-case-scaling=⟨n⟩-funfolding-case-threshold=⟨n⟩-funfolding-creation-threshold=⟨n⟩-funfolding-dict-discount=⟨n⟩-funfolding-fun-discount=⟨n⟩-funfolding-keeness-factor=⟨n⟩-funfolding-use-threshold=⟨n⟩-fworker-wrapper-fworker-wrapper-cbv
✨ Optimization levels ✨
the "just tell me how hard to try" dials. yes, -O0 is listed multiple times in here — that's not a typo on my part bestie, that's literally what the page says:
-O-O1-O0-O0-O2-O0-O⟨n⟩-O0
💖 Package options 💖
the whole "which packages are we even allowed to look at" saga:
-clear-package-db-distrust⟨pkg⟩-distrust-all-packages-fpackage-trust-global-package-db-hide-all-packages-hide-package⟨pkg⟩-ignore-package⟨pkg⟩-no-auto-link-packages-no-global-package-db-no-user-package-db-package⟨pkg⟩-package-db⟨file⟩-package-env⟨file⟩|⟨name⟩-package-id⟨unit-id⟩-this-unit-id⟨unit-id⟩-trust⟨pkg⟩-user-package-db
🦋 Phases of compilation 🦋
where do you want to stop the pipeline, bestie? you can bail out early if you want:
--merge-objs-C-c-E-F-S-x⟨suffix⟩
🎀 Overriding external programs 🎀
not vibing with the default toolchain? swap it out. every -pgm* here lets you point at a different command:
-pgma⟨cmd⟩-pgmc⟨cmd⟩-pgmcxx⟨cmd⟩-pgmdll⟨cmd⟩-pgmF⟨cmd⟩-pgmi⟨cmd⟩-pgminstall_name_tool⟨cmd⟩-pgmL⟨cmd⟩-pgml⟨cmd⟩-pgmlc⟨cmd⟩-pgmlm⟨cmd⟩-pgmlo⟨cmd⟩-pgmotool⟨cmd⟩-pgmP⟨cmd⟩-pgms⟨cmd⟩-pgmwindres⟨cmd⟩
🌈 Phase-specific options 🌈
these pass one extra option straight through to one specific phase of the pipeline. very "I only trust the assembler with this info" energy:
-opta⟨option⟩-optc⟨option⟩-optcxx⟨option⟩-optF⟨option⟩-opti⟨option⟩-optL⟨option⟩-optl⟨option⟩-optlc⟨option⟩-optlm⟨option⟩-optlo⟨option⟩-optP⟨option⟩-optwindres⟨option⟩-pgmc-supports-no-pie-pgml-supports-no-pie
💅 Platform-specific options 💅
CPU feature flags, bestie. only relevant if your target actually has these instruction sets:
-mavx-mavx2-mavx512cd-mavx512er-mavx512f-mavx512pf-mbmi-mbmi2-mfma-msse-msse2-msse3-msse4-msse4.2
🔥 Compiler plugins 🔥
extending GHC itself?? main character behaviour fr:
-fclear-plugins-fplugin-library=⟨file-path⟩;⟨unit-id⟩;⟨module⟩;⟨args⟩-fplugin-opt=⟨module⟩:⟨args⟩-fplugin-trustworthy-fplugin=⟨module⟩-hide-all-plugin-packages-plugin-package⟨pkg⟩-plugin-package-id⟨pkg-id⟩
🍓 Profiling 🍓
the "where is my program spending all its time" toolkit. yes bestie, some of these -fno-prof-auto flags show up more than once — that's the original, I'm keeping it real:
-auto-auto-all-caf-all-fno-prof-count-entries-fprof-count-entries-fprof-auto-fno-prof-auto-fprof-auto-calls-fno-prof-auto-fprof-auto-exported-fno-prof-auto-fprof-auto-top-fno-prof-auto-fprof-cafs-fno-prof-cafs-fprof-callers=⟨name⟩-fprof-late-fno-prof-late-fprof-late-inline-fno-prof-late-inline-fprof-manual-fno-prof-manual-no-auto-no-auto-all-no-caf-all-prof-ticky-ticky-allocd-ticky-ap-thunk-ticky-dyn-thunk-ticky-LNE-ticky-tag-checks
🧚 Program coverage 🧚
for when you need receipts on which lines actually ran:
-fhpc-hpcdir⟨dir⟩
💜 Recompilation checking 💜
GHC loves skipping work it already did. these tune when it bothers redoing things:
-exclude-module=⟨file⟩-fforce-recomp-fno-force-recomp-fignore-hpc-changes-fno-ignore-hpc-changes-fignore-optim-changes-fno-ignore-optim-changes-include-cpp-deps-include-pkg-deps
🌸 Redirecting output 🌸
where do all the little artifacts go?? you get to decide. so many suffixes, so little time:
-dep-makefile⟨file⟩-dep-suffix⟨suffix⟩-dumpdir⟨dir⟩-dynhisuf⟨suffix⟩-dyno⟨file⟩-dynohi⟨file⟩-dynosuf⟨suffix⟩-hcsuf⟨suffix⟩-hidir⟨dir⟩-hiedir⟨dir⟩-hiesuf⟨suffix⟩-hisuf⟨suffix⟩-o⟨file⟩-odir⟨dir⟩-ohi⟨file⟩-osuf⟨suffix⟩-outputdir⟨dir⟩-stubdir⟨dir⟩
🎀 Temporary files 🎀
just the one bestie, and she's iconic:
-tmpdir⟨dir⟩
👑 Verbosity options 👑
this is THE section. the "how much do you want to see" section. hole fits, error formatting, unicode syntax, colours, the whole glow-up. buckle up:
-fabstract-refinement-hole-fits-fno-abstract-refinement-hole-fits-fdefer-diagnostics-fdiagnostics-color=⟨always|auto|never⟩-fdiagnostics-show-caret-fno-diagnostics-show-caret-ferror-spans-fhide-source-paths-fkeep-going-fmax-refinement-hole-fits=⟨n⟩-fno-max-refinement-hole-fits-fmax-relevant-binds=⟨n⟩-fno-max-relevant-binds-fmax-valid-hole-fits=⟨n⟩-fno-max-valid-hole-fits-fno-show-valid-hole-fits-fno-sort-valid-hole-fits-fsort-valid-hole-fits-fprint-axiom-incomps-fno-print-axiom-incomps-fprint-equality-relations-fno-print-equality-relations-fprint-expanded-synonyms-fno-print-expanded-synonyms-fprint-explicit-coercions-fno-print-explicit-coercions-fprint-explicit-foralls-fno-print-explicit-foralls-fprint-explicit-kinds-fno-print-explicit-kinds-fprint-explicit-runtime-reps-fno-print-explicit-runtime-reps-fprint-potential-instances-fno-print-potential-instances-fprint-redundant-promotion-ticks-fno-print-redundant-promotion-ticks-fprint-typechecker-elaboration-fno-print-typechecker-elaboration-fprint-unicode-syntax-fno-print-unicode-syntax-frefinement-level-hole-fits=⟨n⟩-fno-refinement-level-hole-fits-freverse-errors-fno-reverse-errors-fshow-docs-of-hole-fits-fno-show-docs-of-hole-fits-fshow-error-context-fno-show-error-context-fshow-hole-constraints-fshow-hole-matches-of-hole-fits-fno-show-hole-matches-of-hole-fits-fshow-provenance-of-hole-fits-fno-show-provenance-of-hole-fits-fshow-type-app-of-hole-fits-fno-show-type-app-of-hole-fits-fshow-type-app-vars-of-hole-fits-fno-show-type-app-vars-of-hole-fits-fshow-type-of-hole-fits-fno-show-type-of-hole-fits-fsort-by-size-hole-fits-fno-sort-by-size-hole-fits-fsort-by-subsumption-hole-fits-fno-sort-by-subsumption-hole-fits-funclutter-valid-hole-fits-Rghc-timing-v-v⟨n⟩
okay so the warning list is still going, bestie, and honestly it's giving "main character who has a LOT to say" 😭💅 but every single one of these matters so we're doing all of them, no skipping, no cap.
-fenable-th-splice-warnings,-fno-enable-th-splice-warnings— the on/off duo for TH splice warnings-fhelpful-errors,-fno-helpful-errors— flip helpful errors on or off-fmax-pmcheck-models=⟨n⟩— sets the max to ⟨n⟩-fshow-warning-groups,-fno-show-warning-groups— toggle showing warning groups-fvia-C— the-fvia-Cflag, yes it's still here-W,-Wno-extra,-w— the little trio right at the top-Wall,-Wno-all— the famous one and its off-switch-Wall-missed-specialisations,-Wno-all-missed-specialisations,-Wall-missed-specializations,-Wno-all-missed-specializations— both spellings, both directions 🎀-Wambiguous-fields— the ambiguous-fields warning-Wauto-orphans— the auto-orphans warning-Wcompat,-Wno-compat— compat warnings on, compat warnings off-Wcompat-unqualified-imports,-Wno-compat-unqualified-imports— the unqualified-imports version of the same vibe-Wcpp-undef— the cpp-undef warning-Wdefault,-Wno-default— default on / default off-Wdeferred-out-of-scope-variables,-Wno-deferred-out-of-scope-variables— yep, and its negation-Wdeferred-type-errors,-Wno-deferred-type-errors— deferred type errors, on and off-Wdeprecated-flags,-Wno-deprecated-flags— deprecated flags, both ways-Wdeprecations,-Wno-deprecations— deprecations, both ways-Wderiving-defaults,-Wno-deriving-defaults— deriving defaults, both ways-Wderiving-typeable,-Wno-deriving-typeable— deriving typeable, both ways-Wdodgy-exports,-Wno-dodgy-exports— dodgy exports, on and off-Wdodgy-foreign-imports,-Wno-dodgy-foreign-imports— dodgy foreign imports, on and off-Wdodgy-imports,-Wno-dodgy-imports— dodgy imports, on and off-Wduplicate-constraints,-Wno-duplicate-constraints— duplicate constraints, both ways-Wduplicate-exports,-Wno-duplicate-exports— duplicate exports, both ways-Wempty-enumerations,-Wno-empty-enumerations— empty enumerations, both ways-Werror,-Wwarn,-Weverything,-w— the big mood-switch block:-Werror,-Wwarn,-Weverything, and-wagain-Wextended-warnings,-Wno-extended-warnings— extended warnings, on and off-Wextra,-Wno-extra— extra, and no extra-Wforall-identifier,-Wno-forall-identifier— forall identifier, both ways-Wgadt-mono-local-binds,-Wno-gadt-mono-local-binds— gadt mono local binds, both ways-Whi-shadowing,-Wno-hi-shadowing— hi shadowing, on and off-Widentities,-Wno-identities— identities, on and off-Wimplicit-kind-vars,-Wno-implicit-kind-vars— implicit kind vars, both ways-Wimplicit-lift,-Wno-implicit-lift— implicit lift, both ways-Wimplicit-prelude,-Wno-implicit-prelude— implicit prelude, both ways-Wimplicit-rhs-quantification,-Wno-implicit-rhs-quantification— implicit rhs quantification, both ways-Winaccessible-code,-Wno-inaccessible-code— inaccessible code, on and off-Wincomplete-export-warnings,-Wno-incomplete-export-warnings— incomplete export warnings, on and off-Wincomplete-patterns,-Wno-incomplete-patterns— incomplete patterns, on and off-Wincomplete-record-updates,-Wno-incomplete-record-updates— incomplete record updates, on and off-Wincomplete-uni-patterns,-Wno-incomplete-uni-patterns— incomplete uni patterns, on and off-Winconsistent-flags,-Wno-inconsistent-flags,-Winconsistent-flags,-Wno-inconsistent-flags— yes, this pair really does show up twice in the list, iconic behavior honestly 💀-Winferred-safe-imports,-Wno-inferred-safe-imports— inferred safe imports, on and off-Winline-rule-shadowing,-Wno-inline-rule-shadowing— inline rule shadowing, on and off-Winvalid-haddock,-Wno-invalid-haddock— invalid haddock, on and off-Wloopy-superclass-solve,-Wno-loopy-superclass-solve— loopy superclass solve, on and off-Wmisplaced-pragmas,-Wno-misplaced-pragmas— misplaced pragmas, on and off-Wmissed-extra-shared-lib,-Wno-missed-extra-shared-lib— missed extra shared lib, on and off-Wmissed-specialisations,-Wno-missed-specialisations— missed specialisations, on and off-Wmissed-specializations,-Wno-missed-specializations— missed specializations, the other spelling 🦋-Wmissing-deriving-strategies,-Wno-missing-deriving-strategies— missing deriving strategies, on and off-Wmissing-export-lists,-Wno-missing-export-lists— missing export lists, on and off-Wmissing-exported-pattern-synonym-signatures,-Wno-missing-exported-pattern-synonym-signatures— the long one, and its equally long off-switch-Wmissing-exported-signatures,-Wno-missing-exported-signatures— missing exported signatures, on and off-Wmissing-exported-sigs,-Wno-missing-exported-sigs— the short-name version of that one-Wmissing-fields,-Wno-missing-fields— missing fields, on and off-Wmissing-home-modules,-Wno-missing-home-modules— missing home modules, on and off-Wmissing-import-lists,-Wno-missing-import-lists— missing import lists, on and off-Wmissing-kind-signatures,-Wno-missing-kind-signatures— missing kind signatures, on and off-Wmissing-local-signatures,-Wno-missing-local-signatures— missing local signatures, on and off-Wmissing-local-sigs,-Wno-missing-local-sigs— missing local sigs, on and off-Wmissing-methods,-Wno-missing-methods— missing methods, on and off-Wmissing-monadfail-instances,-Wno-missing-monadfail-instances— missing monadfail instances, on and off-Wmissing-pattern-synonym-signatures,-Wno-missing-pattern-synonym-signatures— missing pattern synonym signatures, on and off-Wmissing-poly-kind-signatures,-Wno-missing-poly-kind-signatures— missing poly kind signatures, on and off-Wmissing-role-annotations,-Wno-role-annotations-signatures— role annotations, and its off-switch exactly as written-Wmissing-safe-haskell-mode,-Wno-missing-safe-haskell-mode— missing safe haskell mode, on and off-Wmissing-signatures,-Wno-missing-signatures— missing signatures, on and off-Wmissing-space-after-bang— the missing space after bang warning-Wmonomorphism-restriction,-Wno-monomorphism-restriction— monomorphism restriction, on and off-Wname-shadowing,-Wno-name-shadowing— name shadowing, on and off-Wnoncanonical-monad-instances,-Wno-noncanonical-monad-instances— noncanonical monad instances, on and off-Wnoncanonical-monadfail-instances,-Wno-noncanonical-monadfail-instances— noncanonical monadfail instances, on and off-Wnoncanonical-monoid-instances,-Wno-noncanonical-monoid-instances— noncanonical monoid instances, on and off-Wnot— just-Wnot, standing alone like the main character it is 👑-Woperator-whitespace,-Wno-operator-whitespace— operator whitespace, on and off-Woperator-whitespace-ext-conflict,-Wno-operator-whitespace-ext-conflict— the ext-conflict version-Worphans,-Wno-orphans— orphans, on and off-Woverflowed-literals,-Wno-overflowed-literals— overflowed literals, on and off-Woverlapping-patterns,-Wno-overlapping-patterns— overlapping patterns, on and off-Wpartial-fields,-Wno-partial-fields— partial fields, on and off-Wpartial-type-signatures,-Wno-partial-type-signatures— partial type signatures, on and off-Wprepositive-qualified-module,-Wno-prepositive-qualified-module— prepositive qualified module, on and off-Wredundant-bang-patterns,-Wno-redundant-bang-patterns— redundant bang patterns, on and off-Wredundant-constraints,-Wno-redundant-constraints— redundant constraints, on and off-Wredundant-record-wildcards,-Wno-redundant-record-wildcards— redundant record wildcards, on and off-Wredundant-strictness-flags,-Wno-redundant-strictness-flags— redundant strictness flags, on and off-Wsafe,-Wno-safe— safe, and no safe-Wsemigroup,-Wno-semigroup— semigroup, on and off-Wsimplifiable-class-constraints,-Wno-simplifiable-class-constraints— simplifiable class constraints, on and off-Wstar-binder,-Wno-star-binder— star binder, on and off-Wstar-is-type,-Wno-star-is-type— star is type, on and off-Wtabs,-Wno-tabs— tabs, on and off-Wterm-variable-capture— the term variable capture warning-Wtrustworthy-safe,-Wno-safe— trustworthy safe, plus another-Wno-safe(yep, it appears a second time in this list, we love consistency 🙈)-Wtype-defaults,-Wno-type-defaults— type defaults, on and off-Wtype-equality-out-of-scope,-Wno-type-equality-out-of-scope— type equality out of scope, on and off-Wtype-equality-requires-operators,-Wno-type-equality-requires-operators— type equality requires operators, on and off-Wtyped-holes,-Wno-typed-holes— typed holes, on and off-Wunbanged-strict-patterns,-Wno-unbanged-strict-patterns— unbanged strict patterns, on and off-Wunicode-bidirectional-format-characters— the unicode bidirectional format characters warning-Wunrecognised-pragmas,-Wno-unrecognised-pragmas— unrecognised pragmas, on and off-Wunrecognised-warning-flags,-Wno-unrecognised-warning-flags— unrecognised warning flags, on and off-Wunsafe,-Wno-unsafe— unsafe, on and off-Wunsupported-calling-conventions,-Wno-unsupported-calling-conventions— unsupported calling conventions, on and off-Wunsupported-llvm-version,-Wno-unsupported-llvm-version— unsupported llvm version, on and off-Wunticked-promoted-constructors,-Wno-unticked-promoted-constructors— unticked promoted constructors, on and off-Wunused-binds,-Wno-unused-binds— unused binds, on and off-Wunused-do-bind,-Wno-unused-do-bind— unused do bind, on and off-Wunused-foralls,-Wno-unused-foralls— unused foralls, on and off-Wunused-imports,-Wno-unused-imports— unused imports, on and off-Wunused-local-binds,-Wno-unused-local-binds— unused local binds, on and off-Wunused-matches,-Wno-unused-matches— unused matches, on and off-Wunused-packages,-Wno-unused-packages— unused packages, on and off-Wunused-pattern-binds,-Wno-unused-pattern-binds— unused pattern binds, on and off-Wunused-record-wildcards,-Wno-unused-record-wildcards— unused record wildcards, on and off-Wunused-top-binds,-Wno-unused-top-binds— unused top binds, on and off-Wunused-type-patterns,-Wno-unused-type-patterns— unused type patterns, on and off-Wwarn,-Werror—-Wwarnand-Werroragain, because of course they come back around-Wwarnings-deprecations,-Wno-warnings-deprecations— warnings deprecations, on and off-Wwrong-do-bind,-Wno-wrong-do-bind— wrong do bind, on and off-Wx-⟨category⟩,-Wno-x-⟨category⟩— the custom category flags, with ⟨category⟩ as a placeholder you fill in yourself 🫶
✨ Code generation ✨
okay so this is where GHC actually makes the machine code happen, and the choices here are lowkey iconic:
-dynamic-too— build dynamic object files as well as static object files while it's compiling, both at once, multitasking queen 💅-fasm— use the native code generator-fbyte-code— generate byte-code-fbyte-code-and-object-code— generate object code and byte-code-fexpose-internal-symbols— produce symbols for all functions, including internal functions.-fexternal-dynamic-refs— generate code for linking against dynamic libraries-fllvm— compile using the LLVM code generator-fno-code— omit code generation entirely, just vibes-fobject-code— generate object code-fPIC— generate position-independent code (where available)-fPIE— generate code for a position-independent executable (where available)-fprefer-byte-code— use byte-code if it's available to evaluate TH splices-fwrite-if-simplified-core— write an interface file containing the simplified core of the module.-fwrite-interface— always write interface files-split-objs— split the generated object files into smaller files
🐛 Debugging the compiler 🐛
and now the part for when you're deep in the trenches trying to figure out what GHC is even doing with its life. these are all -d flags and they dump stuff. so much stuff. it's giving "theater kid showing you every single thing" 🎭✨
-dasm-lint— ASM pass sanity checking-dcmm-lint— C-- pass sanity checking-dcore-lint— turn on internal sanity checking-ddisable-js-minifier— generate pretty-printed JavaScript code instead of minified (compacted) code.-ddump-asm— dump the final assembly-ddump-asm-conflicts— dump register conflicts from the register allocator.-ddump-asm-liveness— dump assembly augmented with register liveness-ddump-asm-native— dump the initial assembly-ddump-asm-regalloc— dump the result of register allocation-ddump-asm-regalloc-stages— dump the build/spill stages of the-fregs-graphregister allocator.-ddump-asm-stats— dump statistics from the register allocator.-ddump-bcos— dump interpreter byte code-ddump-c-backend— dump C code produced by the C (unregisterised) backend.-ddump-call-arity— dump output of the call arity analysis pass.-ddump-cfg-weights— dump the assumed weights of the CFG.-ddump-cmm— dump the final C-- output-ddump-cmm-caf— dump the results of the C-- CAF analysis pass.-ddump-cmm-cbe— dump the results of common block elimination-ddump-cmm-cfg— dump the results of the C-- control flow optimisation pass.-ddump-cmm-cps— dump the results of the CPS pass-ddump-cmm-from-stg— dump STG-to-C-- output-ddump-cmm-info— dump the results of the C-- info table augmentation pass.-ddump-cmm-opt— dump the results of C-- to C-- optimising passes-ddump-cmm-proc— dump the results of proc-point analysis-ddump-cmm-procmap— dump the results of the C-- proc-point map pass.-ddump-cmm-raw— dump raw C---ddump-cmm-sink— dump the results of the C-- sinking pass.-ddump-cmm-sp— dump the results of the C-- stack layout pass.-ddump-cmm-split— dump the results of the C-- proc-point splitting pass.-ddump-cmm-switch— dump the results of switch lowering passes-ddump-cmm-thread-sanitizer— dump the results of the C-- ThreadSanitizer elaboration pass.-ddump-cmm-verbose— write output from main C-- pipeline passes to files-ddump-cmm-verbose-by-proc— show output from main C-- pipeline passes (grouped by proc)-ddump-core-stats— print a one-line summary of the size of the Core program at the end of the optimisation pipeline-ddump-cpr-signatures— dump CPR signatures-ddump-cpranal— dump CPR analysis output-ddump-cs-trace— trace the constraint solver-ddump-cse— dump CSE output-ddump-debug— dump generated DWARF debug information-ddump-deriv— dump deriving output-ddump-ds— dump desugarer output.-ddump-ec-trace— trace the exhaustiveness checker-ddump-exitify— dump output of the exitification pass.-ddump-faststrings— bestie, it dumps the entireFastStringtable when everything's finished. the whole thing. no cap 💅- *
-ddump-file-prefix=⟨str⟩* — sets the prefix for the filenames that debugging output gets written to. customise ur dump names, slay. -ddump-float-in— dumps float in output ✨-ddump-foreign— dumps foreign export stubs 🦋-ddump-full-laziness— dumps the output of the full laziness pass. iconic.-ddump-hie— dumps the hie file syntax tree 🌸-ddump-hpc— an alias for-ddump-ticked. same vibe, different name 💖-ddump-if-trace— traces interface files-ddump-inlinings— dumps the inlinings that the simplifier performed 🔥-ddump-js— dumps the final JavaScript code 👑-ddump-json— dumps error messages as JSON documents-ddump-late-cc— dumps core with late cost centres added-ddump-liberate-case— dumps liberate case output-ddump-llvm— dumps LLVM intermediate code ✨-ddump-mod-map— dumps the state of the module mapping database-ddump-occur-anal— dumps occurrence analysis output-ddump-opt-cmm— dumps the results of C-- to C-- optimising passes-ddump-parsed— dumps the parse tree 🌈-ddump-parsed-ast— dumps parser output as a syntax tree-ddump-prep— dumps prepared core-ddump-rn— dumps renamer output-ddump-rn-ast— dumps renamer output as a syntax tree-ddump-rn-stats— renamer stats, bestie 📊-ddump-rn-trace— traces the renamer-ddump-rtti— traces runtime type inference-ddump-rule-firings— dumps rule firing info-ddump-rule-rewrites— dumps detailed rule firing info (the deluxe version 💅)-ddump-rules— dumps rewrite rules-ddump-simpl— dumps the final simplifier output 🔥-ddump-simpl-iterations— dumps output from each simplifier iteration-ddump-simpl-stats— dumps simplifier stats-ddump-simpl-trace— dumps trace messages in the simplifier-ddump-spec— dumps specialiser output-ddump-spec-constr— dumps specialiser output fromSpecConstr-ddump-splices— dumps TH spliced expressions, and what they evaluate to 👀-ddump-static-argument-transformation— dumps static argument transformation output-ddump-stg— (deprecated 🫠) alias for-ddump-stg-from-core-ddump-stg-cg— shows output afterStg2Stg-ddump-stg-final— shows output of the last STG pass ✨-ddump-stg-from-core— showsCoreToStgoutput-ddump-stg-tags— shows output of the tag inference pass-ddump-stg-unarised— shows unarised STG-ddump-str-signatures— dumps top-level demand signatures-ddump-stranal— dumps demand analysis output-ddump-tc— dumps typechecker output-ddump-tc-ast— dumps typechecker output as a syntax tree-ddump-tc-trace— traces the typechecker-ddump-ticked— dumps the code instrumented by HPC (Observing Code Coverage) 💖-ddump-timings— dumps per-pass timing and allocation statistics-ddump-to-file— dumps to files instead of stdout 📁-ddump-types— dumps type signatures-ddump-verbose-inlinings— dumps all considered inlinings, not just the ones that happened-ddump-view-pattern-commoning— dumps commoned view patterns-ddump-worker-wrapper— dumps worker-wrapper output-dfaststring-stats— shows statistics for fast string usage when finished-dhex-word-literals— prints values of typeWord#in hexadecimal 💅- *
-dinitial-unique=⟨s⟩* — startsUniqSupplyallocation from⟨s⟩ - *
-dinline-check=⟨str⟩* — dumps information about inlining decisions -dipe-stats— shows statistics about IPE information-dkeep-comments— includes comments in the parser. lowkey so useful in combination with-ddump-parsed-ast🫶-dlinear-core-lint— turns on internal sanity checking-dlint— enables several common internal sanity checkers 🧚-dno-debug-output— suppresses unsolicited debugging output-dno-typeable-binds— doesn't generate bindings forTypeablemethods-dppr-case-as-let— prints single alternative case expressions as strict lets- *
-dppr-cols=⟨n⟩* — sets the width of debugging output. for example-dppr-cols200 -dppr-debug— turns on debug printing (more verbose 👀)-dppr-user-length— sets the depth for printing expressions in error msgs- *
-drule-check=⟨str⟩* — dumps information about potential rule application -dshow-passes— prints out each pass name as it happens ✨-dstg-lint— STG pass sanity checking-dsuppress-all— in dumps, suppresses everything (except for uniques) that is suppressible. the ultimate minimalism era 💅-dsuppress-coercion-types— suppresses the printing of coercion types in Core dumps to make them shorter-dsuppress-coercions— suppresses the printing of coercions in Core dumps to make them shorter-dsuppress-core-sizes— suppresses the printing of core size stats per binding (since 9.4)-dsuppress-idinfo— suppresses extended information about identifiers where they are bound-dsuppress-module-prefixes— suppresses the printing of module qualification prefixes-dsuppress-stg-free-vars— suppresses the printing of closure free variable lists in STG output-dsuppress-stg-reps— suppresses rep annotations on STG args-dsuppress-ticks— suppresses "ticks" in the pretty-printer output 🎀-dsuppress-timestamps— suppresses timestamps in dumps-dsuppress-type-applications— suppresses type applications-dsuppress-type-signatures— suppresses type signatures-dsuppress-unfoldings— suppresses the printing of the stable unfolding of a variable at its binding site-dsuppress-uniques— suppresses the printing of uniques in debug output (easier to usediff🫶)-dsuppress-var-kinds— suppresses the printing of variable kinds-dtag-inference-checks— affirms tag inference results are correct at runtime-dth-dec-file— dumps evaluated TH declarations into*.th.hsfiles- *
-dunique-increment=⟨i⟩* — sets the increment for the generatedUnique's to⟨i⟩ -dverbose-core2core— shows output from each core-to-core pass-dverbose-stg2stg— shows output from each STG-to-STG pass-falignment-sanitisation— compiles with alignment checks for all info table dereferences-fcatch-nonexhaustive-cases— adds a default error alternative to case expressions without a default alternative-fcheck-prim-bounds— instruments array primops with bounds checks-fcmm-thread-sanitizer— enables ThreadSanitizer instrumentation of memory accesses-fdistinct-constructor-tables— generates a fresh info table for each usage of a data constructor ✨-fdump-with-ways— includes the tag of the enabled ways in the extension of dump files-finfo-table-map— embeds a lookup table in the generated binary which maps the address of an info table to the source position the closure originated from 🗺️-finfo-table-map-with-fallback— includes info tables with no source location information in the info table map-finfo-table-map-with-stack— includes info tables for STACK closures in the info table map-fllvm-fill-undef-with-garbage— intructs LLVM to fill dead STG registers with garbage (yes that's how it's spelled in the original, no I'm not fixing it 💀)-fno-info-table-map-with-fallback— omits info tables with no source location information from the info table map-fno-info-table-map-with-stack— omits info tables for STACK closures from the info table map-fproc-alignment— aligns functions at a given boundary-funoptimized-core-for-interpreter— disables optimizations with the interpreter-g— produces DWARF debug information in compiled object files.⟨n⟩can be0,1, or2, with higher numbers producing richer output. if⟨n⟩is omitted, level2is assumed. no cap 🐛
🎀 C pre-processor 🎀
-cpp— runs the C pre-processor on Haskell source files-D⟨symbol⟩[=⟨value⟩] — defines a symbol in the C pre-processor-I⟨dir⟩— adds⟨dir⟩to the directory search list for#includefiles-U⟨symbol⟩— undefines a symbol in the C pre-processor
🌸 Finding imports 🌸
-i— empties the import directory list-i⟨dir⟩[:⟨dir⟩]* — adds⟨dir⟩,⟨dir2⟩, etc. to the import path 🫶
💅 Interactive mode 💅
-fbreak-on-error— breaks on uncaught exceptions and errors-fbreak-on-exception— breaks on any exception thrown 😭-fbreak-points— inserts breakpoints in the GHCi debugger- *
-fghci-hist-size=⟨n⟩* — sets the number of entries GHCi keeps for:history. see The GHCi Debugger 📚 -fghci-leak-check— (debugging only 👀) checks for space leaks when loading new modules in GHCi-fimplicit-import-qualified— puts in scope qualified identifiers for every loaded module-flocal-ghci-history— uses the current directory for the GHCi command history file.ghci-history-fno-it— no longer sets the special variableit-fprint-bind-result— turns on printing of binding results in GHCi-fprint-evld-with-show— instructs:printto useShowinstances where possible-fshow-loaded-modules— shows the names of modules that GHCi loaded after a:loadcommand-ghci-script— reads additional.ghcifiles-ignore-dot-ghci— disables reading of.ghcifiles-interactive-print⟨name⟩— selects the function to use for printing evaluated expressions in GHCi
✨ Interface files ✨
--show-iface⟨file⟩— see Modes of operation 👑-ddump-hi— dumps the new interface to stdout-ddump-hi-diffs— shows the differences vs. the old interface-ddump-minimal-imports— dumps a minimal set of imports
🦋 Keeping intermediate files 🦋
-keep-hc-file— retains intermediate.hcfiles-keep-hi-files— retains intermediate.hifiles (the default 🫶)-keep-hscpp-file— retains intermediate.hscppfiles-keep-llvm-file— retains intermediate LLVM.llfiles. implies-fllvm✨-keep-o-files— retains intermediate.ofiles (the default 💖)-keep-s-file— retains intermediate.sfiles-keep-tmp-files— retains all intermediate temporary files. the hoarder era, we love to see it 🎀
🌈 Language options 🌈
okay bestie, this is the big one — the whole extension buffet 🍓 every -X flag GHC knows about lives down here, and yes we're doing every single one, no skipping, no "you get the idea" 💅
-XAllowAmbiguousTypes— lets you write ambiguous types, and lets the type inference engine infer them too. chaos, but make it legal ✨-XApplicativeDo— turns on Applicative do-notation desugaring 🎀-XArrows— enables the arrow notation extension 🏹-XBangPatterns— enables bang patterns ⚡-XBinaryLiterals— support for binary literals, as a treat 💖-XBlockArguments— letsdoblocks and other constructs chill as function arguments 🫶-XCApiFFI— enables the CAPI calling convention 🔌-XConstrainedClassMethods— enables constrained class methods ✨-XConstraintKinds— enables a kind of constraints 🧚-XCPP— enables the C preprocessor 🦋-XCUSKs— enables detection of complete user-supplied kind signatures, yes the acronym is iconic, iykyk 👑-XDataKinds— enables datatype promotion 🔥-XDatatypeContexts— allows contexts on data types 💜-XDeepSubsumption— enables deep subsumption 🌊-XDefaultSignatures— enables default signatures 🎀-XDeriveAnyClass— enables deriving for any class 💅-XDeriveDataTypeable— enables deriving for theDataclass ✨-XDeriveFoldable— enables deriving for theFoldableclass. implied byDeriveTraversable🧺-XDeriveFunctor— enables deriving for theFunctorclass. implied byDeriveTraversable🎡-XDeriveGeneric— enables deriving for theGenericclass 🧬-XDeriveLift— enables deriving for theLiftclass 🎈-XDeriveTraversable— enables deriving for theTraversableclass. impliesDeriveFunctorandDeriveFoldable🚀-XDerivingStrategies— enables deriving strategies 🎯-XDerivingVia— enables deriving instances via types of the same runtime representation. impliesDerivingStrategies🛣️-XDisambiguateRecordFields— enables record field disambiguation. implied byRecordWildCards🔍-XDuplicateRecordFields— lets you define record types with identically-named fields. yes, the same name, twice, legally 🙈-XEmptyCase— allows empty case alternatives 🕳️-XEmptyDataDecls— allows definition of empty data types ✨-XEmptyDataDeriving— allows deriving instances of standard type classes for empty data types 🫙-XExistentialQuantification— enables liberalised type synonyms 💫-XExplicitForAll— enables explicit universal quantification. implied byScopedTypeVariables,LiberalTypeSynonyms,RankNTypesandExistentialQuantification🌌-XExplicitNamespaces— enables using the keywordtypeto specify the namespace of entries in imports and exports (explicit namespaces in import/export). implied byTypeOperatorsandTypeFamilies🏷️-XExtendedDefaultRules— uses GHCi's extended default rules in a normal module 🎛️-XExtendedLiterals— enables numeric literal postfix syntax for unboxed integers 🔢-XFieldSelectors— controls visibility of field selector functions 👀-XFlexibleContexts— removes some restrictions on class contexts 🔓-XFlexibleInstances— enables flexible instances. impliesTypeSynonymInstances🤸-XForeignFunctionInterface— enables the foreign function interface 🌍-XFunctionalDependencies— enables functional dependencies. impliesMultiParamTypeClasses🔗-XGADTs— enables generalised algebraic data types. impliesGADTSyntaxandMonoLocalBinds🧠-XGADTSyntax— enables generalised algebraic data type syntax 📝-XGeneralisedNewtypeDeriving— enables newtype deriving 🆕-XGeneralizedNewtypeDeriving— enables newtype deriving (yes bestie, same thing, the spelling variant is real and both are listed) 🆕-XGHC2021— uses GHC's set of default language extensions from 2021 📅-XGHCForeignImportPrim— enables theprimcalling convention. intended for internal use only, so like, don't 🔒-XHaskell2010— uses the Haskell 2010 language variant 📚-XHaskell98— uses the Haskell 98 language variant 📖-XHexFloatLiterals— enables support for hexadecimal floating point literals 🔡-XImplicitParams— enables Implicit Parameters 🫥-XImportQualifiedPost— allows the syntaximport M qualified🎀-XImpredicativeTypes— enables impredicative types. impliesRankNTypes💫-XIncoherentInstances— enables incoherent instances. impliesOverlappingInstances😵💫-XInstanceSigs— enables instance signatures ✍️-XInterruptibleFFI— enables interruptible FFI ⏸️-XKindSignatures— enables kind signatures. implied byTypeFamiliesandPolyKinds🏷️-XLambdaCase— enables lambda-case expressions 🐑-XLexicalNegation— uses whitespace to decide whether the minus sign means negation or subtraction 🤔-XLiberalTypeSynonyms— enables liberalised type synonyms 🌸-XLinearTypes— enables linear types ➡️-XMagicHash— allows#as a postfix modifier on identifiers ✨-XMonadComprehensions— enables monad comprehensions 🌀-XMonoLocalBinds— enables "do not generalise local bindings". implied byTypeFamiliesandGADTs📌-XMultiParamTypeClasses— enables multi parameter type classes. implied byFunctionalDependencies🧩-XMultiWayIf— enables multi-way if-expressions 🔀-XNamedFieldPuns— enables record puns 🎤-XNamedWildCards— enables named wildcards 🃏-XNegativeLiterals— enables support for negative literals ➖-XNoImplicitPrelude— doesn't implicitly importPrelude. implied byRebindableSyntax🚫-XNoMonomorphismRestriction— disables the monomorphism restriction 🙅-XNondecreasingIndentation— allows nested contexts to sit at the same indentation level as their enclosing context 📐-XNoPatternGuards— disables pattern guards. implied byHaskell98🚫-XNoTraditionalRecordSyntax— disables support for traditional record syntax (as supported by Haskell 98), i.e.C {f = x}🚫-XNPlusKPatterns— enables support for n+k patterns. implied byHaskell98➕-XNullaryTypeClasses— deprecated, does nothing. nullary (no parameter) type classes are now enabled usingMultiParamTypeClasses💀-XNumDecimals— enables support for 'fractional' integer literals 🔢-XNumericUnderscores— enables support for numeric underscores1_000_000✨-XOverlappingInstances— enables overlapping instances 🥞-XOverloadedLabels— enables overloaded labels 🏷️-XOverloadedLists— enables overloaded lists 📋-XOverloadedRecordDot— record'.'syntax 🔵-XOverloadedRecordUpdate— record'.'syntax record updates 🔄-XOverloadedStrings— enables overloaded string literals 🧵-XPackageImports— enables package-qualified imports 📦-XParallelListComp— enables parallel list comprehensions 🏃♀️-XPartialTypeSignatures— enables partial type signatures 🧩-XPatternSynonyms— enables pattern synonyms 🔁-XPolyKinds— enables kind polymorphism. impliesKindSignatures🌈-XPostfixOperators— enables postfix operators 📮-XQualifiedDo— enables qualified do-notation desugaring 🎀-XQuantifiedConstraints— allowsforallquantifiers in constraints 🌀-XQuasiQuotes— enables quasiquotation 🪄-XRank2Types— enables rank-2 types. synonym forRankNTypes2️⃣-XRankNTypes— enables rank-N types. implied byImpredicativeTypes🪜-XRebindableSyntax— employs rebindable syntax. impliesNoImplicitPrelude🔧-XRecordWildCards— enables record wildcards. impliesDisambiguateRecordFields🃏-XRecursiveDo— enables recursive do (mdo) notation 🔁-XRoleAnnotations— enables role annotations 🎭-XSafe— enables the Safe Haskell Safe mode 🛡️-XScopedTypeVariables— enables lexically-scoped type variables 🔭-XStandaloneDeriving— enables standalone deriving 🧍-XStandaloneKindSignatures— allows the use of standalone kind signatures 🧍♀️-XStarIsType— treats*asData.Kind.Type⭐-XStaticPointers— enables static pointers 📍-XStrict— makes bindings in the current module strict by default 😤-XStrictData— enables default strict datatype fields 😤-XTemplateHaskell— enables Template Haskell 🧙-XTemplateHaskellQuotes— enables the quotation subset of Template Haskell 🧙♀️-XTransformListComp— enables generalised list comprehensions 🌀-XTrustworthy— enables the Safe Haskell Trustworthy mode 🤝-XTupleSections— enables tuple sections 🍰-XTypeAbstractions— enables type abstraction syntax in patterns and type variable binders 🫧-XTypeApplications— enables type application syntax in terms and types 🎯-XTypeData— enables type data declarations 📦-XTypeFamilies— enables type families. impliesExplicitNamespaces,KindSignatures, andMonoLocalBinds👨👩👧-XTypeFamilyDependencies— enables injective type families. impliesTypeFamilies💉-XTypeInType— deprecated. enables kind polymorphism and datatype promotion 💀-XTypeOperators— enables type operators. impliesExplicitNamespaces➗-XTypeSynonymInstances— enables type synonyms in instance heads. implied byFlexibleInstances🔁-XUnboxedSums— enables unboxed sums 📦-XUnboxedTuples— enables the use of unboxed tuple syntax 📦-XUndecidableInstances— enables undecidable instances 🤷-XUndecidableSuperClasses— allows all superclass constraints, including those that may result in non-termination of the typechecker ⚠️-XUnicodeSyntax— enables unicode syntax 🦄-XUnliftedDatatypes— enables unlifted data types 🪁-XUnliftedFFITypes— enables unlifted FFI types 🪁-XUnliftedNewtypes— enables unlifted newtypes 🪁-XUnsafe— enables Safe Haskell Unsafe mode 💀-XViewPatterns— enables view patterns 👁️
🔗 Linking options 🔗
the part where everything gets, like, stuck together 🫶
-c— stop after generating the object (.o) file 🛑-debug— use the debugging runtime 🐛-dylib-install-name ⟨path⟩— sets the install name (via-install_namepassed to Apple's linker), specifying the full install path of the library file. any libraries or executables that link with it later will pick up that path as their runtime search location for it. (Darwin/OS X only) 🍎-dynamic— build dynamically-linked object files and executables 🌊-dynload— picks which mode we're in for finding shared libraries at runtime. Multiple modes exist, you choose one 💅-eventlog— turns on runtime event tracing. Let the RTS spill the tea in an event log ✨-fcompact-unwind— tells the linker, bestie, to produce a__compact_unwindsection 🎀-fkeep-cafs— do not garbage-collect CAFs (those top-level expressions) at runtime. Keep them, love them, never let them go 🫶-flink-rts— links the runtime when you're generating a shared or static library 🌸-fno-embed-manifest— don't embed the manifest in the executable. (Windows only) 🪟-fno-gen-manifest— don't generate a manifest file at all. (Windows only) 🪟-fno-shared-implib— don't generate an import library for a DLL. (Windows only) 🪟-framework ⟨name⟩— Darwin/OS X/iOS only, link in the framework ⟨name⟩. This one lines up exactly with the-frameworkoption for Apple's Linker 🍎-framework-path ⟨dir⟩— Darwin/OS X/iOS only, add ⟨dir⟩ to the list of directories searched for frameworks. It corresponds to the-Foption for Apple's Linker 🍎-fsplit-sections— split sections so link-time dead-code stripping can do its thing ✂️-fuse-rpaths— sets the rpath based on your-Lflags 🔥-fwhole-archive-hs-libs— when linking a binary executable, this inserts the flag-Wl,--whole-archivebefore any-lflags for Haskell libraries, and-Wl,--no-whole-archiveafterwards. Sandwich energy 🥪-L ⟨dir⟩— add ⟨dir⟩ to the list of directories searched for libraries 🔍-l ⟨lib⟩— link in library ⟨lib⟩ 🔗-main-is ⟨thing⟩— set the main module and function 👑-no-hs-main— don't assume this program containsmain🙈-no-pie— don't instruct the linker to produce a position-independent executable 🚫-no-rtsopts-suggestions— don't print those RTS suggestions about linking with-rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]🤫-package ⟨name⟩— expose package ⟨pkg⟩ 📦-pie— instruct the linker to produce a position-independent executable 🥧-rdynamic— this tells the linker to add all symbols, not only the used ones, to the dynamic symbol table. Currently Linux and Windows/MinGW32 only. It's equivalent to using-optl -rdynamicon Linux, and-optl -export-all-symbolson Windows 💫-rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]— controls whether the RTS behaviour can be tweaked via command-line flags and theGHCRTSenvironment variable. Here's the breakdown, bestie:nonemeans no RTS flags can be givensomemeans only a minimum of safe options can be given (this is the default)all(or no argument at all) means all RTS flags are permittedignoremeans RTS flags can be given, but they're treated as regular arguments and passed to the Haskell program as argumentsignoreAllis the same asignore, butGHCRTSis also ignored
Heads up: -rtsopts does not affect -with-rtsopts behavior; flags passed via -with-rtsopts are used regardless of -rtsopts 😤
-shared— generate a shared library (as opposed to an executable) 🧚-single-threaded— use the single-threaded runtime 🐌-static— use static Haskell libraries 🧱-staticlib— generate a standalone static library (as opposed to an executable). This is useful when cross compiling. The library together with all its dependencies ends up in a single static library that can be linked against 📚-threaded— use the threaded runtime 🧵-with-rtsopts=⟨opts⟩— set the default RTS options to ⟨opts⟩ ⚙️
Miscellaneous options 🎲
-ddump-mod-cycles— dump module cycles 🔄-fdefer-out-of-scope-variables— convert out-of-scope variable errors into warnings. Implied by-fdefer-type-errors. See also-Wdeferred-out-of-scope-variables🩹-fdefer-type-errors— turn type errors into warnings, deferring the error until runtime. Implies-fdefer-typed-holesand-fdefer-out-of-scope-variables. See also-Wdeferred-type-errors🫣-fdefer-typed-holes— convert typed hole errors into warnings, deferring the error until runtime. Implied by-fdefer-type-errors. See also-Wtyped-holes🕳️-fexternal-interpreter— run interpreted code in a separate process 🚀-ffamily-application-cache— use a cache when reducing type family applications 🗃️-fglasgow-exts— Deprecated. Enables most language extensions; see Controlling extensions for exactly which ones 👵-fno-safe-haskell— disable Safe Haskell 🔓-ghcversion-file ⟨path to ghcversion.h⟩— (GHC as a C compiler only) use thisghcversion.hfile 📄-H ⟨size⟩— set the minimum size of the heap to ⟨size⟩ 📏-hidden-module ⟨module name⟩— a module which should not be visible outside its unit 🙈-j[⟨n⟩]— when compiling with--make, compile ⟨n⟩ modules in parallel ⚡-jsem— when compiling with--make, coordinate with other processes through the semaphore ⟨sem⟩ to compile modules in parallel 🚦-reexported-module ⟨module name⟩— a module which should be reexported from this unit 📤-this-package-name ⟨unit-id⟩— the name of the package which this module would be part of when installed 🏷️-unit @⟨filename⟩— specify the options to build a specific unit 🧩-working-dir ⟨dir⟩— specify the directory a unit is expected to be compiled in 📁
Modes of operation 🎭
--frontend ⟨module⟩— run GHC with the given frontend plugin; see Frontend plugins for details 🔌--help— display help 🆘--info— display information about the compiler ℹ️--interactive— interactive mode — normally used by just runningghci; see Using GHCi for details 💬--make— build a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than usingmake; see Usingghc --makefor details 🏗️--numeric-version— display GHC version (numeric only) 🔢--print-booter-version— display bootstrap compiler version 🥾--print-build-platform— display platform on which GHC was built 🏗️--print-c-compiler-flags— C compiler flags used to build GHC 🛠️--print-c-compiler-link-flags— C linker flags used to build GHC 🔗--print-debug-on— print whether GHC was built with-DDEBUG🐛--print-global-package-db— display GHC's global package database directory 🗄️--print-have-interpreter— display whether GHC was built with interactive support 🧠--print-have-native-code-generator— display whether target platform has NCG support ⚙️--print-host-platform— display host platform of GHC 🖥️--print-ld-flags— display linker flags used to compile GHC 🚩--print-leading-underscore— display use of leading underscores on symbol names_--print-libdir— display GHC library directory 📚--print-object-splitting-supported— display whether GHC supports object splitting ✂️--print-project-git-commit-id— display Git commit id GHC is built from 🔖--print-project-version— display GHC version 🏷️--print-rts-ways— display which way RTS was built 🛤️--print-stage— display stage number of GHC 🎚️--print-support-smp— display whether GHC was compiled with SMP support 🧵--print-tables-next-to-code— display whether GHC was compiled with--enable-tables-next-to-code📊--print-target-platform— display target platform of GHC 🎯--print-unregisterised— display whether this GHC was built in unregisterised mode 🚫--run ⟨file⟩— run a Haskell program 🏃--show-iface ⟨file⟩— display the contents of an interface file 🔎--show-options— display the supported command line options 📜--supported-extensions— display the supported language extensions ✨--version— display GHC version 🏷️-e ⟨expr⟩— evaluateexpr; see Expression evaluation mode for details 🧮-M— generate dependency information suitable for use in aMakefile; see Dependency generation for details 📝-shared— create a shared object 🧩
Individual optimizations 🔬
-fasm-shortcutting— enable shortcutting on assembly. Implied by-O2✂️-fbinary-blob-threshold=⟨n⟩— default:500K. Tweak assembly generator for binary blobs 🫧-fblock-layout-cfg— use the new cfg based block layout algorithm. Implied by-O🧱-fblock-layout-weightless— ignore cfg weights for code layout ⚖️-fblock-layout-weights— sets edge weights used by the new code layout algorithm 🏋️-fcall-arity— enable call-arity optimisation. Implied by-O📞-fcase-folding— enable constant folding in case expressions. Implied by-O🗂️-fcase-merge— enable case-merging. Implied by-O🔀-fcmm-control-flow— enable control flow optimisation in the Cmm backend. Implied by-O🌊-fcmm-elim-common-blocks— enable Cmm common block elimination. Implied by-O🧹-fcmm-sink— enable Cmm sinking. Implied by-O🕳️-fcmm-static-pred— enable static control flow prediction. Implied by-O🔮-fcore-constant-folding— enable constant folding in Core. Implied by-O🧊-fcpr-anal— turn on Constructed Product Result analysis. Implied by-O📦-fcross-module-specialise— turn on specialisation of overloaded functions imported from other modules. Implied by-O🔗-fcse— enable common sub-expression elimination. Implied by-O♻️-fdicts-cheap— make dictionary-valued expressions seem cheap to the optimiser 💸-fdicts-strict— make dictionaries strict. Implied by-O2😤-fdmd-tx-dict-sel— (deprecated) use a special demand transformer for dictionary selectors 👵-fdmd-unbox-width=⟨n⟩— default:3. Boxity analysis pretends that returned records with this many fields can be unboxed 📦-fdo-eta-reduction— enable eta-reduction. Always enabled by default. 🌀-fdo-lambda-eta-expansion— enable lambda eta-expansion. Always enabled by default. 🌊-feager-blackholing— turn on eager blackholing 🕳️-fenable-rewrite-rules— switch on all rewrite rules (including rules generated by automatic specialisation of overloaded functions). Implied by-O📏-fexcess-precision— enable excess intermediate precision 🎯-fexitification— enables exitification optimisation. Implied by-O🚪-fexpose-all-unfoldings— spills ALL the unfoldings out in the open, even for the absolutely massive functions and the recursive ones. no hiding 💅-ffloat-in— turns on the float-in transformation. implied by-O.-ffull-laziness— turns on full laziness, aka floating bindings outwards. implied by-O.-ffun-to-thunk— (deprecated) this one got superseded by-ffull-laziness. rip bestie 🪦-fignore-asserts— ignores assertions in the source. implied by-O.-fignore-interface-pragmas— ignores pragmas sitting in interface files. implied by-O0only.-finline-generics— annotates methods of derivedGenericandGeneric1instances withINLINE[1]pragmas, based on heuristics. implied by-O.-finline-generics-aggressively— same energy but unhinged: annotates the methods of ALL derivedGenericandGeneric1instances withINLINE[1]pragmas.-flate-dmd-anal— runs demand analysis again, right at the end of the simplification pipeline.-flate-specialise— runs a late specialisation pass.-fliberate-case— turns on the liberate-case transformation. implied by-O2.-fliberate-case-threshold=⟨n⟩— default:2000. sets the size threshold for the liberate-case transformation to ⟨n⟩.-fllvm-pass-vectors-in-regs— (deprecated) literally does nothing. it's giving decorative ✨-flocal-float-out— enables local floating definitions out of let-binds.-flocal-float-out-top-level— enables local floating to float top-level bindings.-floopification— turns saturated self-recursive tail-calls into local jumps in the generated assembly. implied by-O.-fmax-inline-alloc-size=⟨n⟩— default:128. sets the maximum size of inline array allocations to ⟨n⟩ bytes (default:128).-fmax-inline-memcpy-insns=⟨n⟩— default:32. inlinesmemcpycalls if they'd generate no more than ⟨n⟩ pseudo instructions.-fmax-inline-memset-insns=⟨n⟩— default:32. inlinesmemsetcalls if they'd generate no more than ⟨n⟩ pseudo instructions.-fmax-simplifier-iterations=⟨n⟩— default:4. sets the max iterations for the simplifier.-fmax-uncovered-patterns=⟨n⟩— default:4. sets the max number of patterns to display in warnings about non-exhaustive ones.-fmax-worker-args=⟨n⟩— default:10. maximum number of value arguments for a worker.-fno-opt-coercion— turns off the coercion optimiser.-fno-pre-inlining— turns off pre-inlining.-fno-state-hack— turns off the state hack, whereby any lambda with a real-world state token as an argument is considered single-entry. (hence it's OK to inline things inside it.)-fomit-interface-pragmas— don't generate interface pragmas. implied by-O0only.-fomit-yields— omits heap checks when no allocation is being performed.-foptimal-applicative-do— uses a slower but better algorithm forApplicativeDo.-fpedantic-bottoms— makes GHC way more precise about how it treats bottom (but see also-fno-state-hack). specifically, GHC will not eta-expand through a case expression.-fpolymorphic-specialisation— allows specialisation to abstract over free type variables.-fregs-graph— uses the graph colouring register allocator for register allocation in the native code generator.-fregs-iterative— uses the iterative coalescing graph colouring register allocator in the native code generator.-fsimpl-tick-factor=⟨n⟩— default:100. sets the percentage factor for simplifier ticks.-fsimplifier-phases=⟨n⟩— default:2. sets the number of phases for the simplifier. ignored with-O0.-fsolve-constant-dicts— when solving constraints, tries to eagerly solve super classes using available dictionaries. implied by-O.-fspec-constr— turns on theSpecConstrtransformation. implied by-O2.-fspec-constr-count=⟨n⟩— default:3.*. sets to ⟨n⟩ the maximum number of specialisations that will be created for any one function by theSpecConstrtransformation.-fspec-constr-keen— specialises a call with an explicit constructor argument, even if that argument isn't scrutinised in the body of the function.-fspec-constr-threshold=⟨n⟩— default:2000. sets the size threshold for theSpecConstrtransformation to ⟨n⟩.-fspecialise— turns on specialisation of overloaded functions. implied by-O.-fspecialise-aggressively— turns on specialisation of overloaded functions regardless of size, as long as an unfolding is available.-fspecialise-incoherents— enables specialisation on incoherent instances.-fstatic-argument-transformation— turns on the static argument transformation.-fstg-cse— enables common sub-expression elimination on the STG intermediate language. implied by-O.-fstg-lift-lams— enables late lambda lifting on the STG intermediate language. implied by-O2.-fstg-lift-lams-known— allows turning known calls into unknown calls while performing late lambda lifting.-fstg-lift-lams-non-rec-args— creates top-level non-recursive functions with at most <n> parameters while performing late lambda lifting.-fstg-lift-lams-rec-args— creates top-level recursive functions with at most <n> parameters while performing late lambda lifting.-fstrictness— turns on demand analysis. implied by-O. implies-fworker-wrapper.-fstrictness-before=⟨n⟩— runs an additional demand analysis before simplifier phase ⟨n⟩.-funbox-small-strict-fields— flattens strict constructor fields with a pointer-sized representation. implied by-O.-funbox-strict-fields— flattens strict constructor fields.-funfolding-case-scaling=⟨n⟩— default:30. applies a penalty of(inlining_cost * 1/n)for each level of case nesting.-funfolding-case-threshold=⟨n⟩— default:2. reduces inlining for cases nested deeper than n.-funfolding-creation-threshold=⟨n⟩— default:750. tweaks unfolding settings.-funfolding-dict-discount=⟨n⟩— default:30. tweaks unfolding settings.-funfolding-fun-discount=⟨n⟩— default:60. tweaks unfolding settings.-funfolding-keeness-factor=⟨n⟩— this one has been deprecated in GHC 9.0.1. 💀-funfolding-use-threshold=⟨n⟩— default:80. tweaks unfolding settings.-fworker-wrapper— enables the worker/wrapper transformation. implied by-Oand by-fstrictness.-fworker-wrapper-cbv— enables w/w splits for wrappers whose sole purpose is evaluating arguments.
🌈 Optimization levels 🌈
-O— enable level 1 optimisations ✨-O0— disable optimisations (this is the default, bestie)-O2— enable level 2 optimisations 🔥-O⟨n⟩— any-Onwhere n > 2 is the same as-O2. periodt.
🎀 Package options 🎀
-clear-package-db— clears the package db stack.-distrust ⟨pkg⟩— exposes package ⟨pkg⟩ and sets it to be distrusted. see Safe Haskell.-distrust-all-packages— distrusts all packages by default. see Safe Haskell.-fpackage-trust— enables the Safe Haskell trusted package requirement for trustworthy modules.-global-package-db— adds the global package db to the stack.-hide-all-packages— hides all packages by default.-hide-package ⟨pkg⟩— hides package ⟨pkg⟩.-ignore-package ⟨pkg⟩— ignores package ⟨pkg⟩.-no-auto-link-packages— don't automatically link in thebaseandrtspackages.-no-global-package-db— removes the global package db from the stack.-no-user-package-db— removes the user's package db from the stack.-package ⟨pkg⟩— exposes package ⟨pkg⟩.-package-db ⟨file⟩— adds ⟨file⟩ to the package db stack.-package-env ⟨file⟩|⟨name⟩— uses the specified package environment.-package-id ⟨unit-id⟩— exposes a package by id ⟨unit-id⟩.-this-unit-id ⟨unit-id⟩— compiles to be part of unit (i.e. package) ⟨unit-id⟩.-trust ⟨pkg⟩— exposes package ⟨pkg⟩ and sets it to be trusted. see Safe Haskell.-user-package-db— adds the user's package db to the stack.
🦋 Phases of compilation 🦋
--merge-objs— merges a set of objects into a GHCi library.-C— stop after generating C (.hcfile).-c— stop after generating object (.o) file.-E— stop after preprocessing (.hsppfile).-F— enables the use of a pre-processor (set with-pgmF ⟨cmd⟩).-S— stop after generating assembly (.sfile).-x ⟨suffix⟩— overrides default behaviour for source files.
💅 Overriding external programs 💅
-pgma ⟨cmd⟩— use ⟨cmd⟩ as the assembler.-pgmc ⟨cmd⟩— use ⟨cmd⟩ as the C compiler.-pgmcxx ⟨cmd⟩— use ⟨cmd⟩ as the C++ compiler.-pgmdll ⟨cmd⟩— use ⟨cmd⟩ as the DLL generator.-pgmF ⟨cmd⟩— use ⟨cmd⟩ as the pre-processor (with-Fonly).-pgmi ⟨cmd⟩— use ⟨cmd⟩ as the external interpreter command.-pgminstall_name_tool ⟨cmd⟩— use ⟨cmd⟩ as the program to inject runpath into mach-o dylibs on macOS.-pgmL ⟨cmd⟩— use ⟨cmd⟩ as the literate pre-processor.-pgml ⟨cmd⟩— use ⟨cmd⟩ as the linker.-pgmlc ⟨cmd⟩— use ⟨cmd⟩ as the LLVM compiler.-pgmlm ⟨cmd⟩— use ⟨cmd⟩ as the linker when merging object files.-pgmlo ⟨cmd⟩— use ⟨cmd⟩ as the LLVM optimiser.-pgmotool ⟨cmd⟩— use ⟨cmd⟩ as the program to inspect mach-o dylibs on macOS.-pgmP ⟨cmd⟩— use ⟨cmd⟩ as the C pre-processor (with-cpponly).-pgms ⟨cmd⟩— use ⟨cmd⟩ as the splitter.-pgmwindres ⟨cmd⟩— use ⟨cmd⟩ as the program for embedding manifests on Windows.
🍓 Phase-specific options 🍓
-opta ⟨option⟩— pass ⟨option⟩ to the assembler.-optc ⟨option⟩— pass ⟨option⟩ to the C compiler.-optcxx ⟨option⟩— pass ⟨option⟩ to the C++ compiler.-optF ⟨option⟩— pass ⟨option⟩ to the custom pre-processor.-opti ⟨option⟩— pass ⟨option⟩ to the interpreter sub-process.-optL ⟨option⟩— pass ⟨option⟩ to the literate pre-processor.-optl ⟨option⟩— pass ⟨option⟩ to the linker.-optlc⟨option⟩ — yeet ⟨option⟩ straight at the LLVM compiler 💜-optlm⟨option⟩ — hands ⟨option⟩ to the linker when it's merging object files 🧩-optlo⟨option⟩ — pass ⟨option⟩ to the LLVM optimiser ✨-optP⟨option⟩ — pass ⟨option⟩ tocpp(only works with-cpp, bestie, don't forget) 🎀-optwindres⟨option⟩ — pass ⟨option⟩ towindres-pgmc-supports-no-pie— (deprecated 🙈) says the linker supports-no-pie-pgml-supports-no-pie— says the linker supports-no-pie
🌈 Platform-specific options 🌈
-mavx— (x86 only) turn on support for AVX SIMD extensions-mavx2— (x86 only) turn on support for AVX2 SIMD extensions-mavx512cd— (x86 only) turn on support for AVX512-CD SIMD extensions-mavx512er— (x86 only) turn on support for AVX512-ER SIMD extensions-mavx512f— (x86 only) turn on support for AVX512-F SIMD extensions-mavx512pf— (x86 only) turn on support for AVX512-PF SIMD extensions-mbmi— (x86 only) use BMI1 for bit manipulation operations-mbmi2— (x86 only) use BMI2 for bit manipulation operations-mfma— use native FMA instructions for fused multiply-add floating-point operations ✨-msse— (x86 only) use SSE for floating-point operations-msse2— (x86 only) use SSE2 for floating-point operations-msse3— (x86 only) use SSE3 for floating-point operations-msse4— (x86 only) use SSE4 for floating-point operations-msse4.2— (x86 only) use SSE4.2 for floating-point operations
🧚 Compiler plugins 🧚
-fclear-plugins— wipe the list of active plugins clean 🧹-fplugin-library=⟨file-path⟩;⟨unit-id⟩;⟨module⟩;⟨args⟩— load a pre-compiled static plugin from an external library 📦-fplugin-opt=⟨module⟩:⟨args⟩— give arguments to a plugin module; the module has to be specified with-fplugin=⟨module⟩first, no skipping steps bestie-fplugin-trustworthy— trust the plugins you're using and stop marking the compiled module as unsafe 🫶-fplugin=⟨module⟩— load a plugin that's exported by a given module-hide-all-plugin-packages— hide every package for plugins by default 🙈-plugin-package⟨pkg⟩ — expose ⟨pkg⟩ for plugins-plugin-package-id⟨pkg-id⟩ — expose ⟨pkg-id⟩ for plugins
💅 Profiling 💅
-auto— (deprecated 🙈) alias for-fprof-auto-exported-auto-all— (deprecated 🙈) alias for-fprof-auto-caf-all— (deprecated 🙈) alias for-fprof-cafs-fno-prof-count-entries— don't collect entry counts, we're not counting bestie-fprof-auto— auto-addSCCs to all bindings that aren't markedINLINE-fprof-auto-calls— auto-addSCCs to all call sites-fprof-auto-exported— auto-addSCCs to all exported bindings that aren't markedINLINE-fprof-auto-top— auto-addSCCs to all top-level bindings that aren't markedINLINE-fprof-cafs— auto-addSCCs to all CAFs-fprof-callers=⟨name⟩— auto-addSCCs to all the call-sites of the function named ⟨name⟩-fprof-late— auto-addSCCs to all top level bindings after the core pipeline has run-fprof-late-inline— auto-addSCCs to all top level bindings after the optimizer has run, and keep them around when inlining 🔥-fprof-manual— process manualSCCannotations-no-auto— (deprecated 🙈) alias for-fno-prof-auto-no-auto-all— (deprecated 🙈) alias for-fno-prof-auto-no-caf-all— (deprecated 🙈) alias for-fno-prof-cafs-prof— turn on profiling 📊-ticky— turn on ticky-ticky profiling-ticky-allocd— track how many times each closure type gets allocated-ticky-ap-thunk— don't use standard AP thunks, so you get more reliable entry counters-ticky-dyn-thunk— track allocations of dynamic thunks-ticky-LNE— treat join point binders similar to thunks/functions-ticky-tag-checks— emit dummy ticky counters to record how many tag-inference checks tag inference avoided
🍓 Program coverage 🍓
-fhpc— turn on Haskell program coverage instrumentation-hpcdir⟨dir⟩— set the directory where GHC drops its.mixfiles 📁
🔁 Recompilation checking 🔁
-exclude-module=⟨file⟩— treat ⟨file⟩ as "stable"; i.e. exclude it from having dependencies on it-fforce-recomp— turn off recompilation checking. Heads up: this is implied by any-ddump-Xoption when you're compiling a single file (i.e. when using-c) 👀-fignore-hpc-changes— don't recompile modules just to match changes to HPC flags. Super useful for dodging recompilation when you're using GHCi, and it's on by default for GHCi ✨-fignore-optim-changes— don't recompile modules just to match changes to optimisation flags. Also super useful for avoiding recompilation in GHCi, and also enabled by default for GHCi ✨-include-cpp-deps— include preprocessor dependencies-include-pkg-deps— regard modules imported from packages as unstable
📤 Redirecting output 📤
-dep-makefile⟨file⟩ — use ⟨file⟩ as the makefile-dep-suffix⟨suffix⟩ — make dependencies that declare that files with suffix.⟨suf⟩⟨osuf⟩depend on interface files with suffix.⟨suf⟩hi-dumpdir⟨dir⟩ — redirect dump files-dynhisuf⟨suffix⟩ — set the suffix to use for dynamic interface files-dyno⟨file⟩ — set the dynamic output filename-dynohi⟨file⟩ — set the filename to put the dynamic interface in-dynosuf⟨suffix⟩ — set the dynamic output file suffix-hcsuf⟨suffix⟩ — set the suffix to use for intermediate C files-hidir⟨dir⟩ — set the directory for interface files-hiedir⟨dir⟩ — set the directory for extended interface files-hiesuf⟨suffix⟩ — set the suffix to use for extended interface files-hisuf⟨suffix⟩ — set the suffix to use for interface files-o⟨file⟩ — set the output filename-odir⟨dir⟩ — set the directory for object files-ohi⟨file⟩ — set the filename to put the interface in-osuf⟨suffix⟩ — set the output file suffix-outputdir⟨dir⟩ — set the output directory-stubdir⟨dir⟩ — redirect FFI stub files
🗂 Temporary files 🗂
-tmpdir⟨dir⟩ — set the directory for temporary files
🗣 Verbosity options 🗣
-fabstract-refinement-hole-fits— default: off. Toggles whether refinements where one or more of the holes are abstract get reported-fdefer-diagnostics— defer and group diagnostic messages by severity-fdiagnostics-color=⟨always|auto|never⟩— use colors in error messages 🎨-fdiagnostics-show-caret— whether to show snippets of the original source code-ferror-spans— output the full span in error messages-fhide-source-paths— hide module source and object paths 🙈-fkeep-going— keep compiling as far as possible even when there are errors 💪-fmax-refinement-hole-fits=⟨n⟩— default: 6. Set the max number of refinement hole fits for typed holes to display in type error messages-fmax-relevant-binds=⟨n⟩— default: 6. Set the max number of bindings to display in type error messages-fmax-valid-hole-fits=⟨n⟩— default: 6. Set the max number of valid hole fits for typed holes to display in type error messages-fno-show-valid-hole-fits— disables showing a list of valid hole fits for typed holes in type error messages-fno-sort-valid-hole-fits— disables the sorting of the list of valid hole fits for typed holes in type error messages-fprint-axiom-incomps— display equation incompatibilities in closed type families-fprint-equality-relations— distinguish between equality relations when printing-fprint-expanded-synonyms— in type errors, also print type-synonym-expanded types-fprint-explicit-coercions— print coercions in types-fprint-explicit-foralls— print explicitforallquantification in types. Also peepExplicitForAll👀-fprint-explicit-kinds— print explicit kind foralls and kind arguments in types. Also peepKindSignatures👀-fprint-explicit-runtime-reps— printRuntimeRepandLevityvariables in types which are runtime-representation polymorphic-fprint-potential-instances— display all available instances in type error messages-fprint-redundant-promotion-ticks— print redundantDataKindspromotion ticks-fprint-typechecker-elaboration— print extra information from the typechecker-fprint-unicode-syntax— use unicode syntax when printing expressions, types and kinds. Also peepUnicodeSyntax👀-frefinement-level-hole-fits=⟨n⟩— default: off. Sets the level of refinement of the refinement hole fits, where level n means that hole fits of up to n holes will be considered-freverse-errors— output errors in reverse order-fshow-docs-of-hole-fits— toggles whether to show the documentation of the valid hole fits in the output-fshow-error-context— whether to show textual information about error context-fshow-hole-constraints— show constraints when reporting typed holes-fshow-hole-matches-of-hole-fits— toggles whether to show the type of the additional holes in refinement hole fits-fshow-provenance-of-hole-fits— toggles whether to show the provenance of the valid hole fits in the output-fshow-type-app-of-hole-fits— toggles whether to show the type application of the valid hole fits in the output-fshow-type-app-vars-of-hole-fits— toggles whether to show what type each quantified variable takes in a valid hole fit-fshow-type-of-hole-fits— toggles whether to show the type of the valid hole fits in the output-fsort-by-size-hole-fits— sort valid hole fits by size-fsort-by-subsumption-hole-fits— sort valid hole fits by subsumption-funclutter-valid-hole-fits— unclutter the list of valid hole fits by not showing provenance nor type applications of suggestions 🧹-Rghc-timing— summarise timing stats for GHC (same as+RTS -tstderr) ⏱-v— verbose mode (equivalent to-v3)-v⟨n⟩— set verbosity level
✨ Warnings ✨
ok bestie this is THE section, it's giving "GHC is your very honest friend who will tell you everything wrong with your code" 💅 every single one of these starts with -W (or a sneaky -f), and they're all about the compiler going "hey. hey. bestie. look at this."
-fenable-th-splice-warnings— makes GHC generate warnings for Template Haskell splices. yes, the splices get warnings too, nobody's exempt 🎀-fhelpful-errors— GHC makes suggestions when you mis-spell names. it's literally being nice to you, accept the help 🙈-fmax-pmcheck-models=⟨n⟩ — a soft limit on how many parallel models the pattern match checker should check a pattern match clause against.-fshow-warning-groups— shows which group an emitted warning belongs to. so when you get yelled at you know which squad is yelling 🔥-fvia-C— use the C code generator.-W— enable normal warnings. the standard amount of being perceived 👀-w— disable all warnings. GHC stops looking at you entirely. silence, iconic, also maybe unwise 💀-Wall— enable almost all warnings (details in Warnings and sanity-checking). "almost" doing so much heavy lifting here.-Wall-missed-specialisations— warn when specialisation of any overloaded function fails.-Wall-missed-specializations— alias for-Wall-missed-specialisations. same flag, American spelling, slay 🇺🇸-Wambiguous-fields— warn about ambiguous field selectors or updates.-Wauto-orphans— (deprecated) Does nothing. it literally just stands there. no cap.-Wcompat— enable future compatibility warnings (details in Warnings and sanity-checking). future-proofing your vibe ✨-Wcompat-unqualified-imports— Report unqualified imports of core libraries which are expected to cause compatibility problems in future releases.-Wcpp-undef— warn on uses of the#ifdirective on undefined identifiers.-Wdefault— enable default flags. the factory settings, the vanilla, the baseline 🍦-Wdeferred-out-of-scope-variables— Report warnings when variable out-of-scope errors are deferred until runtime. See-fdefer-out-of-scope-variables.-Wdeferred-type-errors— Report warnings when deferred type errors are enabled. This option is enabled by default. See-fdefer-type-errors. bestie it's on by default, you don't have to do anything 🌸-Wdeprecated-flags— warn about uses of commandline flags that are deprecated. yes it's flag-on-flag snitching.-Wdeprecations— warn about uses of functions & types that haveDEPRECATEDpragmas, orWARNINGpragmas with the deprecated category.-Wderiving-defaults— warn about default deriving when using bothDeriveAnyClassandGeneralizedNewtypeDeriving.-Wderiving-typeable— warn whenTypeableis derived.-Wdodgy-exports— warn about dodgy exports. dodgy. as in sus. as in 🚩-Wdodgy-foreign-imports— warn about dodgy foreign imports.-Wdodgy-imports— warn about dodgy imports.-Wduplicate-constraints— warn when a constraint appears duplicated in a type signature. bestie we saw it the first time 😭-Wduplicate-exports— warn when an entity is exported multiple times.-Wempty-enumerations— warn about enumerations that are empty. nothing in there. void. 💀-Werror— make warnings fatal. every lil warning becomes a full-on error, dramatic as hell, no notes 🔥-Weverything— enable all warnings supported by GHC. ALL of them. the whole menu. you asked for this 👑-Wextended-warnings— warn about uses of functions & types that haveWARNINGorDEPRECATEDpragmas, across all categories.-Wextra— alias for-W.-Wforall-identifier— warn whenforallis used as an identifier (at definition sites).-Wgadt-mono-local-binds— warn when pattern matching on a GADT withoutMonoLocalBinds.-Whi-shadowing— (deprecated) warn when a.hifile in the current directory shadows a library.-Widentities— warn about uses of Prelude numeric conversions that are probably the identity (and hence could be omitted). you're doing nothing and GHC noticed 🫶-Wimplicit-kind-vars— (deprecated) warn when kind variables are implicitly quantified over.-Wimplicit-lift— warn about implicitliftin Template Haskell quotes.-Wimplicit-prelude— warn when the Prelude is implicitly imported.-Wimplicit-rhs-quantification— warn when type variables on the RHS of a type synonym are implicitly quantified.-Winaccessible-code— warn about inaccessible code.-Wincomplete-export-warnings— warn when some but not all of exports for a name are warned about.-Wincomplete-patterns— warn when a pattern match could fail. your case is missing a case bestie 💅-Wincomplete-record-updates— warn when a record update could fail.-Wincomplete-uni-patterns— warn when a pattern match in a lambda expression, pattern binding or a lazy pattern could fail.-Winconsistent-flags— warn when command line options are inconsistent in some way.-Winconsistent-flags— warn when command line options are inconsistent in some way. (yes it's in here twice. we're not editing the sacred text, and honestly? iconic of it. 😭)-Winferred-safe-imports— warn when an explicitly Safe Haskell module imports a Safe-Inferred one.-Winline-rule-shadowing— Warn if a rewriteRULEmight fail to fire because the function might be inlined before the rule has a chance to fire. See How rules interact withINLINE/NOINLINEpragmas.-Winvalid-haddock— warn when a Haddock comment occurs in an invalid position.-Wloopy-superclass-solve— warn when creating potentially-loopy superclass constraint evidence.-Wmisplaced-pragmas— warn about uses of file header pragmas in the module body.-Wmissed-extra-shared-lib— Warn when GHCi can't load a shared lib.-Wmissed-specialisations— warn when specialisation of an imported, overloaded function fails.-Wmissed-specializations— alias for-Wmissed-specialisations.-Wmissing-deriving-strategies— warn when aderivingclause is missing a deriving strategy.-Wmissing-export-lists— warn when a module declaration does not explicitly list all exports.-Wmissing-exported-pattern-synonym-signatures— warn about pattern synonyms without signatures, only if they are exported.-Wmissing-exported-signatures— warn about top-level functions without signatures, only if they are exported.-Wmissing-exported-sigs— (deprecated) warn about top-level functions without signatures, only if they are exported. takes precedence over-Wmissing-signatures.-Wmissing-fields— warn when fields of a record are uninitialised.-Wmissing-home-modules— warn when encountering a home module imported, but not listed on the command line. Useful for cabal to ensure GHC won't pick up modules, not listed neither inexposed-modules, nor inother-modules.-Wmissing-import-lists— warn when an import declaration does not explicitly list all the names brought into scope.-Wmissing-kind-signatures— warn when type declarations don't have kind signatures nor CUSKs.-Wmissing-local-signatures— warn about polymorphic local bindings without signatures.-Wmissing-local-sigs— (deprecated) warn about polymorphic local bindings without signatures.-Wmissing-methods— warn when class methods are undefined.-Wmissing-monadfail-instances— (deprecated) Warn when a failable pattern is used in ado-block that does not have aMonadFailinstance.-Wmissing-pattern-synonym-signatures— warn when pattern synonyms do not have type signatures.-Wmissing-poly-kind-signatures— warn when inferred polykinded type or class declaration don't have kind signatures nor CUSKs.-Wmissing-role-annotations— warn when type declarations don't have role annotations.-Wmissing-safe-haskell-mode— warn when the Safe Haskell mode is not explicitly specified.-Wmissing-signatures— warn about top-level functions without signatures.-Wmissing-space-after-bang— (deprecated) Does nothing. again. just vibing. 🫠-Wmonomorphism-restriction— warn when the Monomorphism Restriction is applied.-Wname-shadowing— warn when names are shadowed. somebody's standing in somebody else's light 🌚-Wnoncanonical-monad-instances— warn whenApplicativeorMonadinstances have noncanonical definitions ofreturn,pure,(>>), or(*>). See flag description in Warnings and sanity-checking for more details.-Wnoncanonical-monadfail-instances— (deprecated) warn whenMonadorMonadFailinstances have noncanonical definitions offail.-Wnoncanonical-monoid-instances— warn whenSemigrouporMonoidinstances have noncanonical definitions of(<>)ormappend. See flag description in Warnings and sanity-checking for more details.-Wnot— (deprecated) Alias for-w.-Woperator-whitespace— warn on prefix, suffix, and tight infix uses of infix operators. spaces are free bestie, use them ✨-Woperator-whitespace-ext-conflict— warn on uses of infix operators that would be parsed differently were a particular GHC extension enabled.-Worphans— warn when the module contains orphan instance declarations or rewrite rules. no parents, no supervision, we're worried about them 🥺-Woverflowed-literals— warn about literals that will overflow their type.-Woverlapping-patterns— warn about overlapping patterns.-Wpartial-fields— warn when defining a partial record field.-Wpartial-type-signatures— warn about holes in partial type signatures whenPartialTypeSignaturesis enabled. Not applicable whenPartialTypeSignaturesis not enabled, in which case errors are generated for such holes.-Wprepositive-qualified-module— Report imports with a leading/prepositive"qualified".-Wredundant-bang-patterns— Warn about redundant bang patterns.-Wredundant-constraints— Have the compiler warn about redundant constraints in type signatures.-Wredundant-record-wildcards— Warn about record wildcard matches when the wildcard binds no patterns.-Wredundant-strictness-flags— Warn about redundant strictness flags.-Wsafe— warn if the module being compiled is regarded to be safe.-Wsemigroup— warn when aMonoidis notSemigroup, and on non-Semigroupdefinitions of(<>)?-Wsimplifiable-class-constraints— Warn about class constraints in a type signature that can be simplified using a top-level instance declaration.-Wstar-binder— warn about binding the(*)type operator despiteStarIsType.-Wstar-is-type— warn when*is used to meanData.Kind.Type.-Wtabs— warn if there are tabs in the source file. tabs. in the source file. the audacity 💀-Wterm-variable-capture— warn when an implicitly quantified type variable captures a term's name.-Wtrustworthy-safe— warn if the module being compiled is marked asTrustworthybut it could instead be marked asSafe, a more informative bound.-Wtype-defaults— warn when defaulting happens.-Wtype-equality-out-of-scope— warn when type equalitya ~ bis used despite being out of scope.-Wtype-equality-requires-operators— warn when type equalitya ~ bis used despite being out of scope.-Wtyped-holes— spills the tea when typed hole errors get deferred all the way to runtime instead of yelling at you at compile time. peek-fdefer-typed-holesfor the deets 💅-Wunbanged-strict-patterns— warns you when you pattern-bind an unlifted variable that's neither bare nor banged. no cap, that's the whole vibe check-Wunicode-bidirectional-format-characters— warns when unicode bidirectional layout override characters show up. sneaky little glyphs fr fr 👀-Wunrecognised-pragmas— warns about pragmas that GHC literally does not recognise. bestie, it doesn't know her 😭-Wunrecognised-warning-flags— throws a warning the second an unrecognised-W...flag rolls up on the command line. it's giving "not me getting clocked at the door" 🚪-Wunsafe— warns if the module being compiled is regarded to be unsafe. go read up on Safe Haskell for the lore-Wunsupported-calling-conventions— warns about use of an unsupported calling convention-Wunsupported-llvm-version— warns when you're using-fllvmwith an unsupported version of LLVM. awkward ✋-Wunticked-promoted-constructors— warns if promoted constructors are not ticked-Wunused-binds— warns about bindings that are unused. it's an alias for-Wunused-top-binds,-Wunused-local-bindsand-Wunused-pattern-binds— three for the price of one, iconic 💖-Wunused-do-bind— warns aboutdobindings that appear to throw away values of types other than()-Wunused-foralls— warns about type variables in user-writtenforall\sthat are unused-Wunused-imports— warns about unnecessary imports. yes bestie, that import is just sitting there doing nothing 🌸-Wunused-local-binds— warns about local bindings that are unused-Wunused-matches— warns about variables in patterns that aren't used-Wunused-packages— warns when a package is requested on the command line, but not needed. it's giving uninvited guest at the function 🫶-Wunused-pattern-binds— warns about pattern match bindings that are unused-Wunused-record-wildcards— warns about record wildcard matches when none of the bound variables are used-Wunused-top-binds— warns about top-level bindings that are unused-Wunused-type-patterns— warns about unused type variables which arise from patterns in type family and data family instances-Wwarn— makes warnings non-fatal. slay, they're just warnings now ✨-Wwarnings-deprecations— warns about uses of functions & types that haveDEPRECATEDpragmas, orWARNINGpragmas with thedeprecatedcategory. it's an alias for-Wdeprecations💜-Wwrong-do-bind— warns aboutdobindings that appear to throw away monadic values that you should have bound instead. bestie that value wanted to be bound 😭-Wx-⟨category⟩— warns about uses of functions & types that haveWARNINGpragmas with the given category
📜 COPYRIGHT 📜
Copyright 2015. The University Court of the University of Glasgow. All rights reserved.
👀 SEE ALSO 👀
https://www.haskell.org/ghc— the GHC homepage 🌈
✍️ AUTHOR ✍️
The GHC Team 👑
💖 COPYRIGHT 💖
2023, GHC Team
and that's a wrap on the whole page, bestie!! this one's from version9.8.4, datedJul 25, 2025🎀 go compile something iconic 💅✨
📦 where this page comes from
- fedora 43: ghc9.8-compiler 9.8.4-16.fc43 · BSD-3-Clause
- fedora 44: ghc9.8-compiler 9.8.4-16.fc43 · BSD-3-Clause
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms