GHC(1)
🔥 GHC(1) — the Glasgow Haskell Compiler 🔥
Okay bestie, this is the manual page for GHC(1) from the Glasgow Haskell Compiler, and we are gonna get you through it with zero boring-manpage energy. It’s giving “compiler lore, but make it group chat.” 💅
✨ NAME ✨
ghc — the Glasgow Haskell Compiler
🌸 SYNOPSIS 🌸
ghc [option|filename]
ghci [option|filename]
🦋 DESCRIPTION 🦋
This manual page documents briefly the ghc and ghci commands. Quick heads-up though:
ghci is not yet available on all architectures. Not me warning you like this, but fr fr, check before you get attached. 😭
Extensive documentation is available in various other formats including PDF at https://downloads.haskell.org/ghc/latest/docs/users_guide.pdf and HTML at 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 💖
Okay so the options are grouped below exactly how the page groups them, and yes, every flag is here. No cap, no skipping the “boring” ones. 🫶
⭐ Code generation ⭐
-dynamic-too— code-generation switch.-fasm— code-generation switch.-fllvm— code-generation switch.-fbyte-code— code-generation switch.-fbyte-code-and-object-code— code-generation switch.-fexpose-internal-symbols— code-generation switch.-fexternal-dynamic-refs— code-generation switch.-fllvm— code-generation switch.-fasm— code-generation switch.-fno-code— code-generation switch.-fobject-code— code-generation switch.-fPIC— code-generation switch.-fPIE— code-generation switch.-fprefer-byte-code— code-generation switch.-fwrite-if-simplified-core— code-generation switch.-fwrite-interface— code-generation switch.-split-objs— code-generation switch.
💀 Debugging the compiler 💀
-dasm-lint— compiler-debugging/dump flag.-dcmm-lint— compiler-debugging/dump flag.-dcore-lint— compiler-debugging/dump flag.-ddump-asm— compiler-debugging/dump flag.-ddump-asm-conflicts— compiler-debugging/dump flag.-ddump-asm-liveness— compiler-debugging/dump flag.-ddump-asm-native— compiler-debugging/dump flag.-ddump-asm-regalloc— compiler-debugging/dump flag.-ddump-asm-regalloc-stages— compiler-debugging/dump flag.-ddump-asm-stats— compiler-debugging/dump flag.-ddump-bcos— compiler-debugging/dump flag.-ddump-c-backend— compiler-debugging/dump flag.-ddump-call-arity— compiler-debugging/dump flag.-ddump-cfg-weights— compiler-debugging/dump flag.-ddump-cmm— compiler-debugging/dump flag.-ddump-cmm-caf— compiler-debugging/dump flag.-ddump-cmm-cbe— compiler-debugging/dump flag.-ddump-cmm-cfg— compiler-debugging/dump flag.-ddump-cmm-cps— compiler-debugging/dump flag.-ddump-cmm-from-stg— compiler-debugging/dump flag.-ddump-cmm-info— compiler-debugging/dump flag.-ddump-cmm-opt— compiler-debugging/dump flag.-ddump-cmm-proc— compiler-debugging/dump flag.-ddump-cmm-procmap— compiler-debugging/dump flag.-ddump-cmm-raw— compiler-debugging/dump flag.-ddump-cmm-sink— compiler-debugging/dump flag.-ddump-cmm-sp— compiler-debugging/dump flag.-ddump-cmm-split— compiler-debugging/dump flag.-ddump-cmm-switch— compiler-debugging/dump flag.-ddump-cmm-thread-sanitizer— compiler-debugging/dump flag.-ddump-cmm-verbose— compiler-debugging/dump flag.-ddump-cmm-verbose-by-proc— compiler-debugging/dump flag.-ddump-core-stats— compiler-debugging/dump flag.-ddump-cpr-signatures— compiler-debugging/dump flag.-ddump-cpranal— compiler-debugging/dump flag.-ddump-cs-trace— compiler-debugging/dump flag.-ddump-cse— compiler-debugging/dump flag.-ddump-debug— compiler-debugging/dump flag.-ddump-deriv— compiler-debugging/dump flag.-ddump-ds— compiler-debugging/dump flag.-ddump-ds-preopt— compiler-debugging/dump flag.-ddump-ec-trace— compiler-debugging/dump flag.-ddump-exitify— compiler-debugging/dump flag.-ddump-faststrings— compiler-debugging/dump flag.-ddump-file-prefix=⟨str⟩— compiler-debugging/dump flag.-ddump-foreign— compiler-debugging/dump flag.-ddump-hie— compiler-debugging/dump flag.-ddump-hpc— compiler-debugging/dump flag.-ddump-if-trace— compiler-debugging/dump flag.-ddump-inlinings— compiler-debugging/dump flag.-ddump-js— compiler-debugging/dump flag.-ddump-json— compiler-debugging/dump flag.-ddump-late-cc— compiler-debugging/dump flag.-ddump-llvm— compiler-debugging/dump flag.-ddump-mod-map— compiler-debugging/dump flag.-ddump-occur-anal— compiler-debugging/dump flag.-ddump-opt-cmm— compiler-debugging/dump flag.-ddump-parsed— compiler-debugging/dump flag.-ddump-parsed-ast— compiler-debugging/dump flag.-ddump-prep— compiler-debugging/dump flag.-ddump-rn— compiler-debugging/dump flag.-ddump-rn-ast— compiler-debugging/dump flag.-ddump-rn-stats— compiler-debugging/dump flag.-ddump-rn-trace— compiler-debugging/dump flag.-ddump-rtti— compiler-debugging/dump flag.-ddump-rule-firings— compiler-debugging/dump flag.-ddump-rule-rewrites— compiler-debugging/dump flag.-ddump-rules— compiler-debugging/dump flag.-ddump-simpl— compiler-debugging/dump flag.-ddump-simpl-iterations— compiler-debugging/dump flag.-ddump-simpl-stats— compiler-debugging/dump flag.-ddump-simpl-trace— compiler-debugging/dump flag.-ddump-spec— compiler-debugging/dump flag.-ddump-splices— compiler-debugging/dump flag.-ddump-stg— compiler-debugging/dump flag.-ddump-stg-cg— compiler-debugging/dump flag.-ddump-stg-final— compiler-debugging/dump flag.-ddump-stg-from-core— compiler-debugging/dump flag.-ddump-stg-tags— compiler-debugging/dump flag.-ddump-stg-unarised— compiler-debugging/dump flag.-ddump-str-signatures— compiler-debugging/dump flag.-ddump-stranal— compiler-debugging/dump flag.-ddump-tc— compiler-debugging/dump flag.-ddump-tc-ast— compiler-debugging/dump flag.-ddump-tc-trace— compiler-debugging/dump flag.-ddump-ticked— compiler-debugging/dump flag.-ddump-timings— compiler-debugging/dump flag.-ddump-to-file— compiler-debugging/dump flag.-ddump-types— compiler-debugging/dump flag.-ddump-verbose-inlinings— compiler-debugging/dump flag.-ddump-view-pattern-commoning— compiler-debugging/dump flag.-ddump-worker-wrapper— compiler-debugging/dump flag.-dfaststring-stats— compiler-debugging/dump flag.-dhex-word-literals— compiler-debugging/dump flag.-dinitial-unique=⟨s⟩— compiler-debugging/dump flag.-dinline-check=⟨str⟩— compiler-debugging/dump flag.-dipe-stats— compiler-debugging/dump flag.-dkeep-comments— compiler-debugging/dump flag.-dlinear-core-lint— compiler-debugging/dump flag.-dlint— compiler-debugging/dump flag.-dno-debug-output— compiler-debugging/dump flag.-ddebug-output— compiler-debugging/dump flag.-dno-typeable-binds— compiler-debugging/dump flag.-dppr-case-as-let— compiler-debugging/dump flag.-dppr-cols=⟨n⟩— compiler-debugging/dump flag.-dppr-debug— compiler-debugging/dump flag.-dppr-user-length— compiler-debugging/dump flag.-drule-check=⟨str⟩— compiler-debugging/dump flag.-dshow-passes— compiler-debugging/dump flag.-dstg-lint— compiler-debugging/dump flag.-dsuppress-all— compiler-debugging/dump flag.-dsuppress-coercion-types— compiler-debugging/dump flag.-dsuppress-coercions— compiler-debugging/dump flag.-dsuppress-core-sizes— compiler-debugging/dump flag.-dsuppress-idinfo— compiler-debugging/dump flag.-dsuppress-module-prefixes— compiler-debugging/dump flag.-dsuppress-stg-free-vars— compiler-debugging/dump flag.-dsuppress-stg-reps— compiler-debugging/dump flag.-dsuppress-ticks— compiler-debugging/dump flag.-dsuppress-timestamps— compiler-debugging/dump flag.-dsuppress-type-applications— compiler-debugging/dump flag.-dsuppress-type-signatures— compiler-debugging/dump flag.-dsuppress-unfoldings— compiler-debugging/dump flag.-dsuppress-uniques— compiler-debugging/dump flag.-dsuppress-var-kinds— compiler-debugging/dump flag.-dtag-inference-checks— compiler-debugging/dump flag.-dth-dec-file— compiler-debugging/dump flag.-dunique-increment=⟨i⟩— compiler-debugging/dump flag.-dverbose-core2core— compiler-debugging/dump flag.-dverbose-stg2stg— compiler-debugging/dump flag.-falignment-sanitisation— compiler-debugging/dump flag.-fcatch-nonexhaustive-cases— compiler-debugging/dump flag.-fcheck-prim-bounds— compiler-debugging/dump flag.-fcmm-thread-sanitizer— compiler-debugging/dump flag.-fdistinct-constructor-tables— compiler-debugging/dump flag.-fdump-with-ways— compiler-debugging/dump flag.-finfo-table-map— compiler-debugging/dump flag.-finfo-table-map-with-fallback— compiler-debugging/dump flag.-fno-info-table-map-with-fallback— compiler-debugging/dump flag.-finfo-table-map-with-stack— compiler-debugging/dump flag.-fno-info-table-map-with-stack— compiler-debugging/dump flag.-fllvm-fill-undef-with-garbage— compiler-debugging/dump flag.-fno-info-table-map-with-fallback— compiler-debugging/dump flag.-finfo-table-map-with-fallback— compiler-debugging/dump flag.-fno-info-table-map-with-stack— compiler-debugging/dump flag.-finfo-table-map-with-stack— compiler-debugging/dump flag.-fproc-alignment— compiler-debugging/dump flag.-g— compiler-debugging/dump flag.-g⟨n⟩— compiler-debugging/dump flag.
🍓 C pre-processor 🍓
-cpp— C preprocessor flag.-D⟨symbol⟩[=⟨value⟩]— C preprocessor flag.-U⟨symbol⟩— C preprocessor flag.-I⟨dir⟩— C preprocessor flag.-U⟨symbol⟩— C preprocessor flag.
🧚 Finding imports 🧚
-i— import-search flag.-i⟨dir⟩[:⟨dir⟩]*— import-search flag.
🌈 Interactive mode 🌈
-fbreak-on-error— GHCi/interactive-mode flag.-fno-break-on-error— GHCi/interactive-mode flag.-fbreak-on-exception— GHCi/interactive-mode flag.-fno-break-on-exception— GHCi/interactive-mode flag.-fghci-hist-size=⟨n⟩— GHCi/interactive-mode flag.-fghci-leak-check— GHCi/interactive-mode flag.-fno-ghci-leak-check— GHCi/interactive-mode flag.-fimplicit-import-qualified— GHCi/interactive-mode flag.-fno-implicit-import-qualified— GHCi/interactive-mode flag.-flocal-ghci-history— GHCi/interactive-mode flag.-fno-local-ghci-history— GHCi/interactive-mode flag.-fno-it— GHCi/interactive-mode flag.-fno-no-it— GHCi/interactive-mode flag.-fprint-bind-result— GHCi/interactive-mode flag.-fno-print-bind-result— GHCi/interactive-mode flag.-fprint-evld-with-show— GHCi/interactive-mode flag.-fshow-loaded-modules— GHCi/interactive-mode flag.-ghci-script— GHCi/interactive-mode flag.-ignore-dot-ghci— GHCi/interactive-mode flag.-no-ignore-dot-ghci— GHCi/interactive-mode flag.-interactive-print ⟨name⟩— GHCi/interactive-mode flag.
🎀 Interface files 🎀
--show-iface ⟨file⟩— interface-file flag.-ddump-hi— interface-file flag.-ddump-hi-diffs— interface-file flag.-ddump-minimal-imports— interface-file flag.
👑 Keeping intermediate files 👑
-keep-hc-file— keep/drop intermediate-files switch.-keep-hc-files— keep/drop intermediate-files switch.-keep-hi-files— keep/drop intermediate-files switch.-no-keep-hi-files— keep/drop intermediate-files switch.-keep-hscpp-file— keep/drop intermediate-files switch.-keep-hscpp-files— keep/drop intermediate-files switch.-keep-llvm-file— keep/drop intermediate-files switch.-keep-llvm-files— keep/drop intermediate-files switch.-keep-o-files— keep/drop intermediate-files switch.-no-keep-o-files— keep/drop intermediate-files switch.-keep-s-file— keep/drop intermediate-files switch.-keep-s-files— keep/drop intermediate-files switch.-keep-tmp-files— keep/drop intermediate-files switch.
🦄 Language options 🦄
-XAllowAmbiguousTypes—-Xlanguage-extension switch.-XApplicativeDo—-Xlanguage-extension switch.-XArrows—-Xlanguage-extension switch.-XBangPatterns—-Xlanguage-extension switch.-XBinaryLiterals—-Xlanguage-extension switch.-XBlockArguments—-Xlanguage-extension switch.-XCApiFFI—-Xlanguage-extension switch.-XConstrainedClassMethods—-Xlanguage-extension switch.-XConstraintKinds—-Xlanguage-extension switch.-XCPP—-Xlanguage-extension switch.-XCUSKs—-Xlanguage-extension switch.-XDataKinds—-Xlanguage-extension switch.-XDatatypeContexts—-Xlanguage-extension switch.-XDeepSubsumption—-Xlanguage-extension switch.-XDefaultSignatures—-Xlanguage-extension switch.-XDeriveAnyClass—-Xlanguage-extension switch.-XDeriveDataTypeable—-Xlanguage-extension switch.-XDeriveFoldable—-Xlanguage-extension switch.-XDeriveFunctor—-Xlanguage-extension switch.-XDeriveGeneric—-Xlanguage-extension switch.-XDeriveLift—-Xlanguage-extension switch.-XDeriveTraversable—-Xlanguage-extension switch.-XDerivingStrategies—-Xlanguage-extension switch.-XDerivingVia—-Xlanguage-extension switch.-XDisambiguateRecordFields—-Xlanguage-extension switch.-XDuplicateRecordFields—-Xlanguage-extension switch.-XEmptyCase—-Xlanguage-extension switch.-XEmptyDataDecls—-Xlanguage-extension switch.-XEmptyDataDeriving—-Xlanguage-extension switch.-XExistentialQuantification—-Xlanguage-extension switch.-XExplicitForAll—-Xlanguage-extension switch.-XExplicitNamespaces—-Xlanguage-extension switch.-XExtendedDefaultRules—-Xlanguage-extension switch.-XFieldSelectors—-Xlanguage-extension switch.-XFlexibleContexts—-Xlanguage-extension switch.-XFlexibleInstances—-Xlanguage-extension switch.-XForeignFunctionInterface—-Xlanguage-extension switch.-XFunctionalDependencies—-Xlanguage-extension switch.-XGADTs—-Xlanguage-extension switch.-XGADTSyntax—-Xlanguage-extension switch.-XGeneralisedNewtypeDeriving—-Xlanguage-extension switch.-XGeneralizedNewtypeDeriving—-Xlanguage-extension switch.-XGHC2021—-Xlanguage-extension switch.-XGHCForeignImportPrim—-Xlanguage-extension switch.-XHaskell2010—-Xlanguage-extension switch.-XHaskell98—-Xlanguage-extension switch.-XHexFloatLiterals—-Xlanguage-extension switch.-XImplicitParams—-Xlanguage-extension switch.-XImportQualifiedPost—-Xlanguage-extension switch.-XImpredicativeTypes—-Xlanguage-extension switch.-XIncoherentInstances—-Xlanguage-extension switch.-XInstanceSigs—-Xlanguage-extension switch.-XInterruptibleFFI—-Xlanguage-extension switch.-XKindSignatures—-Xlanguage-extension switch.-XLambdaCase—-Xlanguage-extension switch.-XLexicalNegation—-Xlanguage-extension switch.-XLiberalTypeSynonyms—-Xlanguage-extension switch.-XLinearTypes—-Xlanguage-extension switch.-XMagicHash—-Xlanguage-extension switch.-XMonadComprehensions—-Xlanguage-extension switch.-XMonoLocalBinds—-Xlanguage-extension switch.-XMultiParamTypeClasses—-Xlanguage-extension switch.-XMultiWayIf—-Xlanguage-extension switch.-XNamedFieldPuns—-Xlanguage-extension switch.-XNamedWildCards—-Xlanguage-extension switch.-XNegativeLiterals—-Xlanguage-extension switch.-XNoImplicitPrelude—-Xlanguage-extension switch.-XNoMonomorphismRestriction—-Xlanguage-extension switch.-XNondecreasingIndentation—-Xlanguage-extension switch.-XNoPatternGuards—-Xlanguage-extension switch.-XNoTraditionalRecordSyntax—-Xlanguage-extension switch.-XNPlusKPatterns—-Xlanguage-extension switch.-XNullaryTypeClasses—-Xlanguage-extension switch.-XNumDecimals—-Xlanguage-extension switch.-XNumericUnderscores—-Xlanguage-extension switch.-XOverlappingInstances—-Xlanguage-extension switch.-XOverloadedLabels—-Xlanguage-extension switch.-XOverloadedLists—-Xlanguage-extension switch.-XOverloadedRecordDot—-Xlanguage-extension switch.-XOverloadedRecordUpdate—-Xlanguage-extension switch.-XOverloadedStrings—-Xlanguage-extension switch.-XPackageImports—-Xlanguage-extension switch.-XParallelListComp—-Xlanguage-extension switch.-XPartialTypeSignatures—-Xlanguage-extension switch.-XPatternSynonyms—-Xlanguage-extension switch.-XPolyKinds—-Xlanguage-extension switch.-XPostfixOperators—-Xlanguage-extension switch.-XQualifiedDo—-Xlanguage-extension switch.-XQuantifiedConstraints—-Xlanguage-extension switch.-XQuasiQuotes—-Xlanguage-extension switch.-XRank2Types—-Xlanguage-extension switch.-XRankNTypes—-Xlanguage-extension switch.-XRebindableSyntax—-Xlanguage-extension switch.-XRecordWildCards—-Xlanguage-extension switch.-XRecursiveDo—-Xlanguage-extension switch.-XRoleAnnotations—-Xlanguage-extension switch.-XSafe—-Xlanguage-extension switch.-XScopedTypeVariables—-Xlanguage-extension switch.-XStandaloneDeriving—-Xlanguage-extension switch.-XStandaloneKindSignatures—-Xlanguage-extension switch.-XStarIsType—-Xlanguage-extension switch.-XStaticPointers—-Xlanguage-extension switch.-XStrict—-Xlanguage-extension switch.-XStrictData—-Xlanguage-extension switch.-XTemplateHaskell—-Xlanguage-extension switch.-XTemplateHaskellQuotes—-Xlanguage-extension switch.-XTransformListComp—-Xlanguage-extension switch.-XTrustworthy—-Xlanguage-extension switch.-XTupleSections—-Xlanguage-extension switch.-XTypeApplications—-Xlanguage-extension switch.-XTypeData—-Xlanguage-extension switch.-XTypeFamilies—-Xlanguage-extension switch.-XTypeFamilyDependencies—-Xlanguage-extension switch.-XTypeInType—-Xlanguage-extension switch.-XTypeOperators—-Xlanguage-extension switch.-XTypeSynonymInstances—-Xlanguage-extension switch.-XUnboxedSums—-Xlanguage-extension switch.-XUnboxedTuples—-Xlanguage-extension switch.-XUndecidableInstances—-Xlanguage-extension switch.-XUndecidableSuperClasses—-Xlanguage-extension switch.-XUnicodeSyntax—-Xlanguage-extension switch.-XUnliftedDatatypes—-Xlanguage-extension switch.-XUnliftedFFITypes—-Xlanguage-extension switch.-XUnliftedNewtypes—-Xlanguage-extension switch.-XUnsafe—-Xlanguage-extension switch.-XViewPatterns—-Xlanguage-extension switch.
🔥 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.-no-pie— linking flag.-rdynamic— linking flag.-rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]— linking flag.-shared— linking flag.-static— linking flag.-staticlib— linking flag.-threaded— linking flag.-with-rtsopts=⟨opts⟩— linking flag.
💜 Miscellaneous options 💜
-ddump-mod-cycles— 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.-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 🌟
--frontend ⟨module⟩— mode-of-operation flag.--help— mode-of-operation flag.-?— mode-of-operation flag.--info— mode-of-operation flag.--interactive— mode-of-operation flag.--make— mode-of-operation flag.--numeric-version— mode-of-operation flag.--print-booter-version— mode-of-operation flag.--print-build-platform— mode-of-operation flag.--print-c-compiler-flags— mode-of-operation flag.--print-c-compiler-link-flags— mode-of-operation flag.--print-debug-on— mode-of-operation flag.--print-global-package-db— mode-of-operation flag.--print-have-interpreter— mode-of-operation flag.--print-have-native-code-generator— mode-of-operation flag.--print-host-platform— mode-of-operation flag.--print-ld-flags— mode-of-operation flag.--print-leading-underscore— mode-of-operation flag.--print-libdir— mode-of-operation flag.--print-object-splitting-supported— mode-of-operation flag.--print-project-git-commit-id— mode-of-operation flag.--print-project-version— mode-of-operation flag.--print-rts-ways— mode-of-operation flag.--print-stage— mode-of-operation flag.--print-support-smp— mode-of-operation flag.--print-tables-next-to-code— mode-of-operation flag.--print-target-platform— mode-of-operation flag.--print-unregisterised— mode-of-operation flag.--run ⟨file⟩— mode-of-operation flag.--show-iface ⟨file⟩— mode-of-operation flag.--show-options— mode-of-operation flag.--supported-extensions— mode-of-operation flag.--supported-languages— mode-of-operation flag.--version— mode-of-operation flag.-V— mode-of-operation flag.-e ⟨expr⟩— mode-of-operation flag.-M— mode-of-operation flag.-shared— mode-of-operation flag.
🎀 Individual optimizations 🎀
Okay bestie, real talk: the original page drops this entire buffet of flags with like ZERO explanation, so I'm not gonna invent lore for you — I'm just handing you the full list, exactly as written, so nothing goes missing. Collect them like Pokémon, iykyk 💅
-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·-fspec-eval·-fno-spec-eval-fspec-eval-dictfun·-fno-spec-eval-dictfun·-fspecialise-fno-specialise·-fspecialise-aggressively-fno-specialise-aggressively·-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
Yes, -funfolding-keeness-factor really is spelled with that double-e. Not a typo I introduced, I promise — copy it exactly, bestie 🫶
🔥 Optimization levels 🔥
-O·-O1·-O0·-O0·-O2·-O0·-O⟨n⟩·-O0
The repeated -O0s are literally in the page as written. I am simply the messenger 💀
📦 Package options 📦
All the flags for telling GHC which packages it's allowed to see and trust — here's the whole set, no cap:
-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 🧚
Stop at any point in the pipeline, babe — pick your phase:
--merge-objs·-C·-c·-E·-F·-S·-x ⟨suffix⟩
🛠️ Overriding external programs 🛠️
Swap out the external tool GHC calls at each step with a command of your choosing:
-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 ✨
Same energy, but you're slipping an option to one specific phase:
-opta ⟨option⟩·-optc ⟨option⟩·-optcxx ⟨option⟩·-optdll ⟨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 switches, all lowercase and vibey:
-mavx·-mavx2·-mavx512cd·-mavx512er·-mavx512f·-mavx512pf-mbmi·-mbmi2-msse·-msse2·-msse3·-msse4·-msse4.2
🧩 Compiler plugins 🧩
Plug in your own compiler behaviour like the main character you are:
-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 👑
Cost-centre time, bestie — the whole profiling spread plus the ticky-tacky instrumentation crew:
-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
That -fno-prof-auto showing up three times in a row? Also straight from the page, no notes 😭
🍓 Program coverage 🍓
-fhpc·-hpcdir⟨dir⟩
-hpcdir⟨dir⟩genuinely has no space before⟨dir⟩in the page. Keep it exactly like that, okay? 💖
🔁 Recompilation checking 🔁
-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 files go? You decide, diva:
-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 💜
-tmpdir ⟨dir⟩
Just the one. She's lowkey iconic for standing alone 🌸
🌟 Verbosity options 🌟
Big section, deep breath — diagnostics, hole fits, printing, and how loud GHC talks to you:
-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⟩
💅 Warnings 💅
Okay so. Bestie. Deep breath. 🫶 This next bit is the warning-flag guest list and it is long. Like, "the group chat has 300 unread messages" long. Not one of these gets a description in the original — they're just here, chilling — so I'm not gonna invent one for you, I'm just gonna hand you the whole list exactly as it appears, in order, no edits, no dupe-removal (and yes, some of these literally appear twice, that's the manpage's business, not mine 😭). Swipe through, screenshot it, put it on a vision board, whatever helps. 💖
-fdefer-out-of-scope-variables,-fno-defer-out-of-scope-variables-fdefer-type-errors,-fno-defer-type-errors,-fdefer-typed-holes-fno-defer-typed-holes,-fenable-th-splice-warnings-fno-enable-th-splice-warnings,-fhelpful-errors-fno-helpful-errors,-fmax-pmcheck-models=⟨n⟩-fshow-warning-groups,-fno-show-warning-groups,-fvia-C,-W,-w,-w-Wall,-w,-Wall-missed-specialisations-Wno-all-missed-specialisations,-Wall-missed-specializations-Wno-all-missed-specializations,-Wambiguous-fields,-Wauto-orphans-Wcompat,-Wno-compat,-Wcompat-unqualified-imports-Wno-compat-unqualified-imports,-Wcpp-undef,-Wdefault-Wdeferred-out-of-scope-variables-Wno-deferred-out-of-scope-variables,-Wdeferred-type-errors-Wno-deferred-type-errors,-Wdeprecated-flags-Wno-deprecated-flags,-Wdeprecations,-Wno-deprecations-Wderiving-defaults,-Wno-deriving-defaults,-Wderiving-typeable-Wno-deriving-typeable,-Wdodgy-exports,-Wno-dodgy-exports-Wdodgy-foreign-imports,-Wno-dodgy-foreign-imports-Wdodgy-imports,-Wno-dodgy-imports,-Wduplicate-constraints-Wno-duplicate-constraints,-Wduplicate-exports-Wno-duplicate-exports,-Wempty-enumerations-Wno-empty-enumerations,-Werror,-Wwarn,-Weverything,-Wextra,-w-Wforall-identifier,-Wno-forall-identifier-Wgadt-mono-local-binds,-Wno-gadt-mono-local-binds,-Whi-shadowing-Wno-hi-shadowing,-Widentities,-Wno-identities-Wimplicit-kind-vars,-Wno-implicit-kind-vars,-Wimplicit-lift-Wno-implicit-lift,-Wimplicit-prelude,-Wno-implicit-prelude-Winaccessible-code,-Wno-inaccessible-code,-Wincomplete-patterns-Wno-incomplete-patterns,-Wincomplete-record-updates-Wno-incomplete-record-updates,-Wincomplete-uni-patterns-Wno-incomplete-uni-patterns,-Winferred-safe-imports-Wno-inferred-safe-imports,-Winline-rule-shadowing-Wno-inline-rule-shadowing,-Winvalid-haddock,-Wno-invalid-haddock-Wloopy-superclass-solve,-Wno-loopy-superclass-solve-Wmisplaced-pragmas,-Wno-misplaced-pragmas-Wmissed-extra-shared-lib,-Wno-missed-extra-shared-lib-Wmissed-specialisations,-Wno-missed-specialisations-Wmissed-specializations,-Wno-missed-specializations-Wmissing-deriving-strategies,-Wno-missing-deriving-strategies-Wmissing-export-lists,-Wno-missing-export-lists-Wmissing-exported-pattern-synonym-signatures-Wno-missing-exported-pattern-synonym-signatures-Wmissing-exported-signatures,-Wno-missing-exported-signatures-Wmissing-exported-sigs,-Wno-missing-exported-sigs-Wmissing-fields,-Wno-missing-fields,-Wmissing-home-modules-Wno-missing-home-modules,-Wmissing-import-lists-Wno-missing-import-lists,-Wmissing-kind-signatures-Wno-missing-kind-signatures,-Wmissing-local-signatures-Wno-missing-local-signatures,-Wmissing-local-sigs-Wno-missing-local-sigs,-Wmissing-methods,-Wno-missing-methods-Wmissing-monadfail-instances,-Wno-missing-monadfail-instances-Wmissing-pattern-synonym-signatures-Wno-missing-pattern-synonym-signatures-Wmissing-safe-haskell-mode,-Wno-missing-safe-haskell-mode-Wmissing-signatures,-Wno-missing-signatures-Wmissing-space-after-bang,-Wmonomorphism-restriction-Wno-monomorphism-restriction,-Wname-shadowing-Wno-name-shadowing,-Wno-compat,-Wcompat-Wnoncanonical-monad-instances,-Wno-noncanonical-monad-instances-Wnoncanonical-monadfail-instances-Wno-noncanonical-monadfail-instances-Wnoncanonical-monoid-instances-Wno-noncanonical-monoid-instances,-Wnot,-Woperator-whitespace-Wno-operator-whitespace,-Woperator-whitespace-ext-conflict-Wno-operator-whitespace-ext-conflict,-Worphans,-Wno-orphans-Woverflowed-literals,-Wno-overflowed-literals-Woverlapping-patterns,-Wno-overlapping-patterns,-Wpartial-fields-Wno-partial-fields,-Wpartial-type-signatures-Wno-partial-type-signatures,-Wprepositive-qualified-module-Wno-prepositive-qualified-module,-Wredundant-bang-patterns-Wno-redundant-bang-patterns,-Wredundant-constraints-Wno-redundant-constraints,-Wredundant-record-wildcards-Wno-redundant-record-wildcards,-Wredundant-strictness-flags-Wno-redundant-strictness-flags,-Wsafe,-Wno-safe,-Wsemigroup-Wno-semigroup,-Wsimplifiable-class-constraints-Wno-simplifiable-class-constraints,-Wstar-binder-Wno-star-binder,-Wstar-is-type,-Wno-star-is-type,-Wtabs-Wno-tabs,-Wtrustworthy-safe,-Wno-safe,-Wtype-defaults-Wno-type-defaults,-Wtype-equality-out-of-scope-Wno-type-equality-out-of-scope-Wtype-equality-requires-operators-Wno-type-equality-requires-operators,-Wtyped-holes-Wno-typed-holes,-Wunbanged-strict-patterns-Wno-unbanged-strict-patterns-Wunicode-bidirectional-format-characters,-Wunrecognised-pragmas-Wno-unrecognised-pragmas,-Wunrecognised-warning-flags-Wno-unrecognised-warning-flags,-Wunsafe,-Wno-unsafe-Wunsupported-calling-conventions-Wno-unsupported-calling-conventions,-Wunsupported-llvm-version-Wno-monomorphism-restriction,-Wunticked-promoted-constructors-Wno-unticked-promoted-constructors,-Wunused-binds-Wno-unused-binds,-Wunused-do-bind,-Wno-unused-do-bind-Wunused-foralls,-Wno-unused-foralls,-Wunused-imports-Wno-unused-imports,-Wunused-local-binds,-Wno-unused-local-binds-Wunused-matches,-Wno-unused-matches,-Wunused-packages-Wno-unused-packages,-Wunused-pattern-binds-Wno-unused-pattern-binds,-Wunused-record-wildcards-Wno-unused-record-wildcards,-Wunused-top-binds-Wno-unused-top-binds,-Wunused-type-patterns-Wno-unused-type-patterns,-Wwarn,-Werror,-Wwarnings-deprecations-Wno-warnings-deprecations,-Wwrong-do-bind,-Wno-wrong-do-bind
bestie I need you to know I did not get cute with this list. Every single one is there, in that exact order, duplicates and all.-Wno-safeshows up twice.-Werror/-Wwarnshows up once going one way and once going the other.-Wno-monomorphism-restrictionis in there twice too. That's the manpage being the manpage, not me being sloppy 💀
🔥 Code generation 🔥
This is the section where you tell GHC what it should actually be spitting out. Object files? Byte-code? Nothing at all? Iconic choices, all of them. 👑
-dynamic-too— builds the dynamic object files and the static object files while it's compiling, i.e. it does both, because it can 🫶-fasm— use the native code generator, periodt-fbyte-code— generate byte-code-fbyte-code-and-object-code— generate object code and byte-code, why choose-fexpose-internal-symbols— produce symbols for all functions, including the internal ones (yes, even those)-fexternal-dynamic-refs— generate code for linking against dynamic libraries-fllvm— compile using the LLVM code generator-fno-code— omit code generation entirely, we're just here for the 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 🔬
Feeling nosy? Same. 👀 This whole section is GHC letting you peek behind the curtain — linting its own passes, dumping every intermediate thing it's got, tracing stuff. Ngl, this is the "let me see the receipts" section and it ate. Every single one of these is a -d flag and they are all listed below, no skips.
-dasm-lint— ASM pass sanity checking-dcmm-lint—C--pass sanity checking-dcore-lint— turn on internal sanity checking-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 finalC--output-ddump-cmm-caf— dump the results of theC--CAF analysis pass-ddump-cmm-cbe— dump the results of common block elimination-ddump-cmm-cfg— dump the results of theC--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 theC--info table augmentation pass-ddump-cmm-opt— dump the results ofC--toC--optimising passes-ddump-cmm-proc— dump the results of proc-point analysis-ddump-cmm-procmap— dump the results of theC--proc-point map pass-ddump-cmm-raw— dump rawC---ddump-cmm-sink— dump the results of theC--sinking pass-ddump-cmm-sp— dump the results of theC--stack layout pass-ddump-cmm-split— dump the results of theC--proc-point splitting pass-ddump-cmm-switch— dump the results of switch lowering passes-ddump-cmm-thread-sanitizer— dump the results of theC--ThreadSanitizer elaboration pass-ddump-cmm-verbose— write output from mainC--pipeline passes to files-ddump-cmm-verbose-by-proc— show output from mainC--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 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 exhaustiveness checker-ddump-exitify— dump output of the exitification pass-ddump-faststrings— dump the whole FastString table when finished-ddump-file-prefix=⟨str⟩— set the prefix of the filenames used for debugging output-ddump-foreign— dump foreign export stubs-ddump-hie— dump the hie file syntax tree-ddump-hpc— an alias for-ddump-ticked-ddump-if-trace— trace interface files-ddump-inlinings— dump inlinings performed by the simplifier-ddump-js— dump the final JavaScript code 🌈-ddump-json— dumps error messages as JSON documents, so your tooling can slurp them up 💅-ddump-late-cc— dumps core with late cost centres added-ddump-llvm— dumps the LLVM intermediate code-ddump-mod-map— dumps the state of the module mapping database-ddump-occur-anal— dumps the occurrence analysis output-ddump-opt-cmm— dumps the results ofC--toC--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-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-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-splices— dumps TH spliced expressions, and what they evaluate to-ddump-stg— (deprecated 👀) alias for-ddump-stg-from-core-ddump-stg-cg— shows output after Stg2Stg-ddump-stg-final— shows output of the last STG pass-ddump-stg-from-core— shows CoreToStg output-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 (hpc)-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-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⟩— starts UniqSupply allocation from ⟨s⟩-dinline-check=⟨str⟩— dumps information about inlining decisions-dipe-stats— shows statistics about IPE information-dkeep-comments— includes comments in the parser. Super 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-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 (way easier to usediffon, lowkey a lifesaver 🧚)-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— instructs LLVM to fill dead STG registers with garbage (the manpage spells it "Intruct", and honestly? iconic of 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 given boundary-g— produces DWARF debug information in compiled object files. ⟨n⟩ can be0,1, or2, with higher numbers producing richer output. If ⟨n⟩ is omitted, level 2 is assumed 🎀
🌈 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-fghci-hist-size=⟨n⟩— sets the number of entries GHCi keeps for:history. Seeghci-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-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 (this is the default, bestie)-keep-hscpp-file— retains intermediate.hscppfiles-keep-llvm-file— retains intermediate LLVM.llfiles. Implies-fllvm-keep-o-files— retains intermediate.ofiles (also the default 💅)-keep-s-file— retains intermediate.sfiles-keep-tmp-files— retains all intermediate temporary files
🦋 Language options 🦋
-XAllowAmbiguousTypes— allows the user to write ambiguous types, and the type inference engine to infer them-XApplicativeDo— enables Applicative do-notation desugaring-XArrows— enables arrow notation extension-XBangPatterns— enables bang patterns-XBinaryLiterals— enables support for binary literals-XBlockArguments— allows do blocks and other constructs as function arguments-XCApiFFI— enables theCAPIcalling 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-XDataKinds— enables datatype promotion-XDatatypeContexts— allows contexts on data types-XDeepSubsumption— enables deep subsumption-XDefaultSignatures— enables default signatures ✨-XDeriveAnyClass— lets you derive for literally any class, no cap ✨-XDeriveDataTypeable— turns on deriving for theDataclass 🎀-XDeriveFoldable— enables deriving for theFoldableclass. Heads up bestie: it's implied byDeriveTraversable💜-XDeriveFunctor— enables deriving for theFunctorclass. Also implied byDeriveTraversable💜-XDeriveGeneric— enables deriving for theGenericclass 🌸-XDeriveLift— enables deriving for theLiftclass 🦋-XDeriveTraversable— enables deriving for theTraversableclass. Big sibling energy: it impliesDeriveFunctorandDeriveFoldable👑-XDerivingStrategies— turns on deriving strategies 💅-XDerivingVia— enables deriving instances via types of the same runtime representation. ImpliesDerivingStrategies✨-XDisambiguateRecordFields— enables record field disambiguation. Implied byRecordWildCards🎀-XDuplicateRecordFields— allows definition of record types with identically-named fields 👯♀️-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— "enable liberalised type synonyms." That's literally what the page says, bestie, I'm just the messenger 😭🙈-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). Implied byTypeOperatorsandTypeFamilies🏷️-XExtendedDefaultRules— uses GHCi's extended default rules in a normal module 🌈-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 (British spelling, iconic) 🇬🇧-XGeneralizedNewtypeDeriving— enables newtype deriving (American spelling, also iconic) 🇺🇸-XGHC2021— uses GHC's set of default language extensions from 2021 🗓️-XGHCForeignImportPrim— enablesprimcalling convention. > ⚠️ Intended for internal use only. You didn't hear it from me, bestie 💀-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—ImportQualifiedPostallows 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 determine whether the minus sign stands for 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— don't implicitly importPrelude. Implied byRebindableSyntax🙅♀️-XNoMonomorphismRestriction— disables the monomorphism restriction 🚫-XNondecreasingIndentation— allows nested contexts to be at the same indentation level as its enclosing context 📐-XNoPatternGuards— disables pattern guards. Implied byHaskell98🛡️-XNoTraditionalRecordSyntax— disables support for traditional record syntax (as supported by Haskell 98)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. It's a synonym forRankNTypes👯-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 ✂️-XTypeApplications— enables type application syntax in terms, patterns 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 🌀💀 (she's risky, bestie, proceed with vibes intact)-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 🔗
okay bestie this whole group is about the linker, the part that stitches everything together at the end 🧵✨
-c— stop after generating 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, iykyk)-dynamic— build dynamically-linked object files and executables 🌀-dynload— selects one of a number of modes for finding shared libraries at runtime 🔎-eventlog— enables runtime event tracing 📊-fcompact-unwind— instructs the linker to produce a__compact_unwindsection 🗜️-fkeep-cafs— do not garbage-collect CAFs (top-level expressions) at runtime 🗑️🚫-flink-rts— link the runtime when generating a shared or static library 🔗-fno-embed-manifest— do not embed the manifest in the executable 🪟 (Windows only)-fno-gen-manifest— do not generate a manifest file 🪟 (Windows only)-fno-shared-implib— don't generate an import library for a DLL 🪟 (Windows only)-framework⟨*name*⟩ — on Darwin/OS X/iOS only, link in the framework ⟨*name*⟩. This option corresponds to the-frameworkoption for Apple's Linker 🍎-framework-path⟨*dir*⟩ — on Darwin/OS X/iOS only, add ⟨*dir*⟩ to the list of directories searched for frameworks. This option corresponds to the-Foption for Apple's Linker 🍎-fsplit-sections— split sections for link-time dead-code stripping ✂️-fuse-rpaths— set the rpath based on-Lflags 🛤️-fwhole-archive-hs-libs— bestie, when you're linking a binary executable this one literally sticks the flag-Wl,--whole-archivebefore any-lflags for Haskell libraries, then drops-Wl,--no-whole-archivein afterwards. Bookends. Iconic. ✨-L ⟨dir⟩— adds ⟨dir⟩ to the list of directories that get searched for libraries 🫶-l ⟨lib⟩— links in the library ⟨lib⟩ 🔗-main-is ⟨thing⟩— sets the main module and function 👑-no-hs-main— tells GHC to not assume this program containsmain🙈-no-pie— don't instruct the linker to produce a position-independent executable-no-rtsopts-suggestions— don't print out those RTS suggestions about linking with-rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]💅-package ⟨name⟩— exposes package ⟨pkg⟩ 📦-pie— instructs the linker to produce a position-independent executable-rdynamic— tells the linker to add all symbols to the dynamic symbol table, not just the used ones. Currently Linux and Windows/MinGW32 only, ngl. It's equivalent to using-optl -rdynamicon Linux, and-optl -export-all-symbolson Windows 🌈-rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]— controls whether RTS behaviour can be tweaked via command-line flags and theGHCRTSenvironment variable. Here's the tea, one value at a time:nonemeans no RTS flags can be given at allsomemeans 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 bestie: -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)-static— use static Haskell libraries-staticlib— generate a standalone static library (as opposed to an executable). This is lowkey so 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⟩— sets the default RTS options to ⟨opts⟩
🧩 Miscellaneous options 🧩
-ddump-mod-cycles— dumps module cycles 🌀-fexternal-interpreter— runs interpreted code in a separate process-ffamily-application-cache— uses a cache when reducing type family applications-fglasgow-exts— deprecated, bestie. It enables most language extensions; see options-language for exactly which ones 👀-fno-safe-haskell— disables Safe Haskell-ghcversion-file ⟨path to ghcversion.h⟩— (GHC as a C compiler only) use thisghcversion.hfile 📄-H ⟨size⟩— sets 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, compiles ⟨n⟩ 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⟩— runs GHC with the given frontend plugin; see frontend_plugins for the deets 🧚--help— display help 🆘--info— display information about the compiler--interactive— interactive mode, normally used by just runningghci; see ghci for details 💬--make— builds a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than usingmake; see make-mode for 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⟩— evaluate expr; see eval-mode for details-M— generate dependency information suitable for use in a Makefile; see makefile-dependencies for details 🛠️-shared— create a shared object
⚡ Individual optimizations ⚡
Like, this is the optimization buffet, bestie. Grab a plate 🍓
-fasm-shortcutting— enables shortcutting on assembly-fbinary-blob-threshold=⟨n⟩— default:500K. Tweaks the assembly generator for binary blobs-fblock-layout-cfg— uses the new cfg based block layout algorithm-fblock-layout-weightless— ignores cfg weights for code layout-fblock-layout-weights— sets edge weights used by the new code layout algorithm-fcall-arity— enables call-arity optimisation. Implied by-O👑-fcase-folding— enables constant folding in case expressions. Implied by-O-fcase-merge— enables case-merging. Implied by-O-fcmm-control-flow— enables control flow optimisation in the Cmm backend. Implied by-O-fcmm-elim-common-blocks— enables Cmm common block elimination. Implied by-O-fcmm-sink— enables Cmm sinking. Implied by-O-fcmm-static-pred— enables static control flow prediction. Implied by-O-fcore-constant-folding— enables constant folding in Core. Implied by-O-fcpr-anal— turns on Constructed Product Result analysis. Implied by-O-fcross-module-specialise— turns on specialisation of overloaded functions imported from other modules 🔄-fcse— enables common sub-expression elimination. Implied by-O-fdicts-cheap— makes dictionary-valued expressions seem cheap to the optimiser 💸-fdicts-strict— makes dictionaries strict. Implied by-O2-fdmd-tx-dict-sel— (deprecated) uses 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— enables eta-reduction. Implied by-O-fdo-lambda-eta-expansion— enables lambda eta-expansion. Always enabled by default ✅-feager-blackholing— turns on eager blackholing 🕳️-fenable-rewrite-rules— switches on all rewrite rules (including rules generated by automatic specialisation of overloaded functions). Implied by-O-fexcess-precision— enables excess intermediate precision-fexitification— enables exitification optimisation. Implied by-O-fexpose-all-unfoldings— exposes all unfoldings, even for very large or recursive functions 👀-ffloat-in— turns on the float-in transformation. Implied by-O-ffull-laziness— turns on full laziness (floating bindings outwards). Implied by-O🦋-ffun-to-thunk— (deprecated) superseded by-ffull-laziness-fignore-asserts— ignores assertions in the source. Implied by-O-fignore-interface-pragmas— ignores pragmas in interface files. Implied by-O0only-finline-generics— annotates methods of derivedGenericandGeneric1instances withINLINE[1]pragmas based on heuristics. Implied by-O-finline-generics-aggressively— annotates methods of all derivedGenericandGeneric1instances withINLINE[1]pragmas 🔥-flate-dmd-anal— runs demand analysis again, 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) does nothing 💀-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 would generate no more than ⟨n⟩ pseudo instructions-fmax-inline-memset-insns=⟨n⟩— default:32. Inlinesmemsetcalls if they would generate no more than ⟨n⟩ pseudo instructions-fmax-simplifier-iterations=⟨n⟩— default:4. Caps how many rounds the simplifier is allowed to go, bestie. Max iterations, periodt.-fmax-uncovered-patterns=⟨n⟩— default:4. Sets the maximum number of patterns to display when GHC is warning you about non-exhaustive ones. Not me getting only 4 screenshots of my missing cases 😭-fmax-worker-args=⟨n⟩— default:10. The maximum number of value arguments a worker can have.-fno-opt-coercion— Turn off the coercion optimiser. Bye bestie 💅-fno-pre-inlining— Turn off pre-inlining.-fno-state-hack— Turns off the state hack, which is the whole thing where any lambda with a real-world state token as an argument is considered to be single-entry — and hence it's OK to inline stuff inside it. Lowkey unhinged but it works.-fomit-interface-pragmas— Don't generate interface pragmas. Only implied by-O0.-fomit-yields— Omit heap checks when no allocation is being performed. Efficiency slay ✨-foptimal-applicative-do— Use a slower but better algorithm forApplicativeDo. The way that "slower but better" is literally the most relatable thing ever.-fpedantic-bottoms— Makes GHC be more precise about how it treats bottom (but see also-fno-state-hack). In particular, GHC will not eta-expand through a case expression. Pedantic? Yes. Correct? Also yes 🎀-fpolymorphic-specialisation— Allow specialisation to abstract over free type variables.-fregs-graph— Use the graph colouring register allocator for register allocation in the native code generator.-fregs-iterative— Use the iterative coalescing graph colouring register allocator in the native code generator. Extra word, extra iconic.-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, try to eagerly solve super classes using the dictionaries that are available. Eager is my middle name 🫶-fspec-constr— Turn on the SpecConstr transformation. 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 the SpecConstr transformation.-fspec-constr-keen— Specialize a call with an explicit constructor argument, even if that argument is not scrutinised in the body of the function. Keen is right there in the name, bestie 🔥-fspec-constr-threshold=⟨n⟩— default:2000. Sets the size threshold for the SpecConstr transformation to ⟨n⟩.-fspec-eval— Enables speculative evaluation.-fspec-eval-dictfun— Enables speculative evaluation of dictionary functions.-fspecialise— Turn on specialisation of overloaded functions. Implied by-O.-fspecialise-aggressively— Turn on specialisation of overloaded functions regardless of size, if unfolding is available. Aggressive in a cutesy way 💅-fstatic-argument-transformation— Turn on the static argument transformation.-fstg-cse— Enable common sub-expression elimination on the STG intermediate language.-fstg-lift-lams— Enable late lambda lifting on the STG intermediate language. Implied by-O2.-fstg-lift-lams-known— Allow turning known into unknown calls while performing late lambda lifting.-fstg-lift-lams-non-rec-args— Create top-level non-recursive functions with at most<n>parameters while performing late lambda lifting.-fstg-lift-lams-rec-args— Create top-level recursive functions with at most<n>parameters while performing late lambda lifting.-fstrictness— Turn on demand analysis. Implied by-O. Implies-fworker-wrapper.-fstrictness-before=⟨n⟩— Run an additional demand analysis before simplifier phase ⟨n⟩.-funbox-small-strict-fields— Flatten strict constructor fields with a pointer-sized representation. Implied by-O.-funbox-strict-fields— Flatten strict constructor fields.-funfolding-case-scaling=⟨n⟩— default:30. Apply a penalty of (inlining_cost * 1/n) for each level of case nesting.-funfolding-case-threshold=⟨n⟩— default:2. Reduce inlining for cases nested deeper than n.-funfolding-creation-threshold=⟨n⟩— default:750. Tweak unfolding settings.-funfolding-dict-discount=⟨n⟩— default:30. Tweak unfolding settings.-funfolding-fun-discount=⟨n⟩— default:60. Tweak unfolding settings.-funfolding-keeness-factor=⟨n⟩— This has been deprecated in GHC 9.0.1. She's gone, bestie 😔 (yes, the spelling really is "keeness", we don't make the rules)-funfolding-use-threshold=⟨n⟩— default:80. Tweak unfolding settings.-fworker-wrapper— Enable the worker/wrapper transformation.-fworker-wrapper-cbv— Enable w/w splits for wrappers whose sole purpose is evaluating arguments.
🌈 Optimization levels 🌈
-O— Enable level 1 optimisations.-O0— Disable optimisations (default). The chill mode.-O2— Enable level 2 optimisations. The main character mode 👑-O⟨n⟩— Any-Onwhere n > 2 is the same as-O2. So-O47? Still-O2. We love a cap.
🎀 Package options 🎀
-clear-package-db— Clear the package db stack.-distrust ⟨pkg⟩— Expose package ⟨pkg⟩ and set it to be distrusted. Seesafe-haskell.-distrust-all-packages— Distrust all packages by default. Seesafe-haskell. Trust issues fr fr 🙈-fpackage-trust— Enable Safe Haskell trusted package requirement for trustworthy modules.-global-package-db— Add the global package db to the stack.-hide-all-packages— Hide all packages by default.-hide-package ⟨pkg⟩— Hide package ⟨pkg⟩.-ignore-package ⟨pkg⟩— Ignore package ⟨pkg⟩.-no-auto-link-packages— Don't automatically link in thebaseandrtspackages.-no-global-package-db— Remove the global package db from the stack.-no-user-package-db— Remove the user's package db from the stack.-package ⟨pkg⟩— Expose package ⟨pkg⟩.-package-db ⟨file⟩— Add ⟨file⟩ to the package db stack.-package-env ⟨file⟩|⟨name⟩— Use the specified package environment.-package-id ⟨unit-id⟩— Expose package by id ⟨unit-id⟩.-this-unit-id ⟨unit-id⟩— Compile to be part of unit (i.e. package) ⟨unit-id⟩.-trust ⟨pkg⟩— Expose package ⟨pkg⟩ and set it to be trusted. Seesafe-haskell.-user-package-db— Add the user's package db to the stack.
🦋 Phases of compilation 🦋
--merge-objs— Merge 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— Enable the use of a pre-processor (set with-pgmF ⟨cmd⟩).-S— Stop after generating assembly (.sfile).-x ⟨suffix⟩— Override 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. (Yes, the capitalLand lowercaselare two whole different besties, look carefully.)-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.-optdll ⟨option⟩— pass ⟨option⟩ to the DLL generator.-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⟩— pass ⟨option⟩ to the LLVM compiler.-optlm ⟨option⟩— pass ⟨option⟩ to the linker when merging object files.-optlo ⟨option⟩— pass ⟨option⟩ to the LLVM optimiser.-optP ⟨option⟩— pass ⟨option⟩ tocpp(with-cpponly).-optwindres ⟨option⟩— pass ⟨option⟩ towindres.-pgmc-supports-no-pie— (deprecated) Indicate that the linker supports-no-pie.-pgml-supports-no-pie— Indicate that the linker supports-no-pie.
🌸 Platform-specific options 🌸
All of these are x86-only, bestie — if you're on ARM, this section is not your moment, and that's okay 🫶
-mavx— (x86 only) Enable support for AVX SIMD extensions.-mavx2— (x86 only) Enable support for AVX2 SIMD extensions.-mavx512cd— (x86 only) Enable support for AVX512-CD SIMD extensions.-mavx512er— (x86 only) Enable support for AVX512-ER SIMD extensions.-mavx512f— (x86 only) Enable support for AVX512-F SIMD extensions.-mavx512pf— (x86 only) Enable support for AVX512-PF SIMD extensions.-mbmi— (x86 only) Use BMI1 for bit manipulation operations.-mbmi2— (x86 only) Use BMI2 for bit manipulation 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— Clear the list of active plugins. Fresh start energy ✨-fplugin-library=⟨file-path⟩;⟨unit-id⟩;⟨module⟩;⟨args⟩— Load a pre-compiled static plugin from an external library. Note the semicolons, bestie — those separators are load-bearing.-fplugin-opt=⟨module⟩:⟨args⟩— Give arguments to a plugin module; the module must be specified with-fplugin=⟨module⟩.-fplugin-trustworthy— Trust the used plugins and no longer mark the compiled module asunsafe.-fplugin=⟨module⟩— Load a plugin exported by a given module.
...and we're back, bestie, picking up right inside the plugin-packages section like nothing happened 💅
-hide-all-plugin-packages— hides every single package usable by plugins, by default. full lockdown mode 🔒-plugin-package⟨pkg⟩ — exposes ⟨pkg⟩ for plugins ✨-plugin-package-id⟨pkg-id⟩ — exposes ⟨pkg-id⟩ for plugins, by id 🎀
✨ Profiling ✨
okay so this whole section is about making your program spill the tea on where it spends its time. several of these are deprecated so don't come for me, I'm just reporting what the page says 😭
-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 🚫-fprof-auto— auto-add SCCs to all bindings that aren't markedINLINE-fprof-auto-calls— auto-add SCCs to all call sites 📞-fprof-auto-exported— auto-add SCCs to all exported bindings that aren't markedINLINE-fprof-auto-top— auto-add SCCs to all top-level bindings that aren't markedINLINE-fprof-cafs— auto-add SCCs to all CAFs-fprof-callers=⟨name⟩ — auto-add SCCs to all call-sites of the named function-fprof-late— auto-add SCCs to all top-level bindings after the core pipeline has run ⏰-fprof-late-inline— auto-add SCCs to all top-level bindings after the optimizer has run, and keep them when inlining 💫-fprof-manual— process manual SCC annotations, i.e. the ones you wrote yourself ✍️-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 (yes that's the real name, iconic)-ticky-allocd— track how many times each closure type gets allocated 📊-ticky-ap-thunk— don't use standard AP thunks, in order to 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 places.mixfiles
🦋 Recompilation checking 🦋
the "did anything actually change tho" department 🫶
-exclude-module=⟨file⟩ — regard ⟨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 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 in 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 dodging recompilation in GHCi, and also on by default for GHCi-include-cpp-deps— include preprocessor dependencies-include-pkg-deps— regard modules imported from packages as unstable
🌈 Redirecting output 🌈
the "where do my files go" era, we love a good -odir moment 💅
-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 dynamic output filename-dynohi⟨file⟩ — set the filename in which to put the dynamic interface-dynosuf⟨suffix⟩ — set the dynamic output file suffix-hcsuf⟨suffix⟩ — set the suffix to use for intermediate C files-hidir⟨dir⟩ — set directory for interface files-hiedir⟨dir⟩ — set 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 output filename-odir⟨dir⟩ — set directory for object files-ohi⟨file⟩ — set the filename in which to put the interface-osuf⟨suffix⟩ — set the output file suffix-outputdir⟨dir⟩ — set output directory-stubdir⟨dir⟩ — redirect FFI stub files
🍓 Temporary files 🍓
-tmpdir⟨dir⟩ — set the directory for temporary files
👑 Verbosity options 👑
this is the "tell me everything, I want the whole lore" section, and honestly? obsessed 💖
-fabstract-refinement-hole-fits— default: off. Toggles whether refinements where one or more of the holes are abstract are 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 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 shown in type error messages-fmax-relevant-binds=⟨n⟩ — default: 6. Set the max number of bindings shown in type error messages-fmax-valid-hole-fits=⟨n⟩ — default: 6. Set the max number of valid hole fits for typed holes shown in type error messages-fno-show-valid-hole-fits— stops showing a list of valid hole fits for typed holes in type error messages-fno-sort-valid-hole-fits— stops 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. See alsoExplicitForAll-fprint-explicit-kinds— print explicit kind foralls and kind arguments in types. See alsoKindSignatures-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. See alsoUnicodeSyntax-frefinement-level-hole-fits=⟨n⟩ — default: off. Sets the level of refinement of the refinement hole fits, where level n means 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 💀
the "hey bestie, just so you know" section. read these, they're literally saving you from yourself 🫶
-fdefer-out-of-scope-variables— convert variable 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-fenable-th-splice-warnings— generate warnings for Template Haskell splices-fhelpful-errors— make suggestions for mis-spelled names 🥺 (she's trying to help)-fmax-pmcheck-models=⟨n⟩ — soft limit on the number of parallel models the pattern match checker should check a pattern match clause against-fshow-warning-groups— show which group an emitted warning belongs to-fvia-C— use the C code generator-W— enable normal warnings-w— disable all warnings-Wall— enable almost all warnings (details inoptions-sanity)-Wall-missed-specialisations— warn when specialisation of any overloaded function fails-Wall-missed-specializations— alias for-Wall-missed-specialisations-Wambiguous-fields— warn about ambiguous field selectors or updates-Wauto-orphans— (deprecated) does nothing 💀 literally nothing, bestie-Wcompat— enable future compatibility warnings (details inoptions-sanity)-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-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— hollers at you when deferred type errors are turned on. this one's on by default, bestie, so she's always in the room. peek at-fdefer-type-errors.-Wdeprecated-flags— warns you when you're using commandline flags that are deprecated. yes, the flags themselves can be old news 💀-Wdeprecations— warns about uses of functions & types that have warnings or deprecated pragmas attached. it's literally an alias for-Wwarnings-deprecations.-Wderiving-defaults— warns about default deriving when you're using bothDeriveAnyClassandGeneralizedNewtypeDerivingat the same time. pick a lane, honestly.-Wderiving-typeable— warns whenTypeableis derived.-Wdodgy-exports— warns about dodgy exports. suspicious behavior detected 👀-Wdodgy-foreign-imports— warns about dodgy foreign imports.-Wdodgy-imports— warns about dodgy imports.-Wduplicate-constraints— warns when a constraint shows up duplicated in a type signature. we see you, saying the same thing twice.-Wduplicate-exports— warns when an entity gets exported multiple times.-Wempty-enumerations— warns about enumerations that are empty. nothing to see here, literally.-Werror— makes warnings fatal. every little warning becomes a whole entire crisis 🔥-Weverything— turns on all warnings supported by GHC. all of them. no crumbs.-Wextra— alias for-W.-Wforall-identifier— warns whenforallis used as an identifier (at definition sites).-Wgadt-mono-local-binds— warns when you pattern match on a GADT withoutMonoLocalBinds.-Whi-shadowing— (deprecated) warns when a.hifile in the current directory shadows a library. rude behavior, honestly.-Widentities— warns about uses of Prelude numeric conversions that are probably the identity (and hence could be omitted). like, why are you even doing that.-Wimplicit-kind-vars— (deprecated) warns when kind variables are implicitly quantified over.-Wimplicit-lift— warns about implicitliftin Template Haskell quotes.-Wimplicit-prelude— warns when the Prelude is implicitly imported. she just showed up uninvited 💅-Winaccessible-code— warns about inaccessible code.-Wincomplete-patterns— warns when a pattern match could fail. the classic "you forgot a case" moment 😭-Wincomplete-record-updates— warns when a record update could fail.-Wincomplete-uni-patterns— warns when a pattern match in a lambda expression, pattern binding or a lazy pattern could fail.-Winferred-safe-imports— warns when an explicitly Safe Haskell module imports a Safe-Inferred one.-Winline-rule-shadowing— Warns if a rewrite RULE might fail to fire because the function might be inlined before the rule has a chance to fire. Seerules-inline.-Winvalid-haddock— warns when a Haddock comment occurs in an invalid position.-Wloopy-superclass-solve— warns when creating potentially-loopy superclass constraint evidence. going in circles is not the vibe 🌀-Wmisplaced-pragmas— warns about uses of file header pragmas in the module body. wrong place, bestie.-Wmissed-extra-shared-lib— Warns when GHCi can't load a shared lib.-Wmissed-specialisations— warns when specialisation of an imported, overloaded function fails.-Wmissed-specializations— alias for-Wmissed-specialisations.-Wmissing-deriving-strategies— warns when a deriving clause is missing a deriving strategy.-Wmissing-export-lists— warns when a module declaration does not explicitly list all exports.-Wmissing-exported-pattern-synonym-signatures— warns about pattern synonyms without signatures, only if they are exported.-Wmissing-exported-signatures— warns about top-level functions without signatures, only if they are exported.-Wmissing-exported-sigs— (deprecated) warns about top-level functions without signatures, only if they are exported. takes precedence over-Wmissing-signatures.-Wmissing-fields— warns when fields of a record are uninitialised. fill in the blanks, babe.-Wmissing-home-modules— warns 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— warns when an import declaration does not explicitly list all the names brought into scope.-Wmissing-kind-signatures— warns when type declarations don't have kind signatures nor CUSKs.-Wmissing-local-signatures— warns about polymorphic local bindings without signatures.-Wmissing-local-sigs— (deprecated) warns about polymorphic local bindings without signatures.-Wmissing-methods— warns when class methods are undefined.-Wmissing-monadfail-instances— (deprecated) Warns when a failable pattern is used in a do-block that does not have aMonadFailinstance.-Wmissing-pattern-synonym-signatures— warns when pattern synonyms do not have type signatures.-Wmissing-safe-haskell-mode— warns when the Safe Haskell mode is not explicitly specified.-Wmissing-signatures— warns about top-level functions without signatures.-Wmissing-space-after-bang— (deprecated) Does nothing. iconic honestly, she just sits there.-Wmonomorphism-restriction— warns when the Monomorphism Restriction is applied.-Wname-shadowing— warns when names are shadowed.-Wno-compat— Disables all warnings enabled by-Wcompat.-Wnoncanonical-monad-instances— warns whenApplicativeorMonadinstances have noncanonical definitions ofreturn,pure,(>>), or(*>). See flag description inoptions-sanityfor more details.-Wnoncanonical-monadfail-instances— (deprecated) warns whenMonadorMonadFailinstances have noncanonical definitions offail.-Wnoncanonical-monoid-instances— warns whenSemigrouporMonoidinstances have noncanonical definitions of(<>)ormappend. See flag description inoptions-sanityfor more details.-Wnot— (deprecated) Alias for-w.-Woperator-whitespace— warns on prefix, suffix, and tight infix uses of infix operators. spacing is self-care 🎀-Woperator-whitespace-ext-conflict— warns on uses of infix operators that would be parsed differently were a particular GHC extension enabled.-Worphans— warns when the module contains orphan instance declarations or rewrite rules.-Woverflowed-literals— warns about literals that will overflow their type.-Woverlapping-patterns— warns about overlapping patterns.-Wpartial-fields— warns when defining a partial record field.-Wpartial-type-signatures— warns 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— Reports imports with a leading/prepositive "qualified".-Wredundant-bang-patterns— Warns about redundant bang patterns.-Wredundant-constraints— Have the compiler warn about redundant constraints in type signatures.-Wredundant-record-wildcards— Warns about record wildcard matches when the wildcard binds no patterns.-Wredundant-strictness-flags— Warns about redundant strictness flags.-Wsafe— warn if the module being compiled is regarded to be safe.-Wsemigroup— warns when aMonoidis notSemigroup, and on non-Semigroupdefinitions of(<>).-Wsimplifiable-class-constraints— Warns about class constraints in a type signature that can be simplified using a top-level instance declaration.-Wstar-binder— warns about binding the(*)type operator despiteStarIsType.-Wstar-is-type— warns when*is used to meanData.Kind.Type.-Wtabs— warn if there are tabs in the source file. spaces girlies stay winning ✨-Wtrustworthy-safe— warns if the module being compiled is marked asTrustworthybut it could instead be marked asSafe, a more informative bound.-Wtype-defaults— warns when defaulting happens.-Wtype-equality-out-of-scope— warns when type equalitya ~ bis used despite being out of scope.-Wtype-equality-requires-operators— warns when type equalitya ~ bis used despite being out of scope.-Wtyped-holes— Reports warnings when typed hole errors are deferred until runtime. See-fdefer-typed-holes.-Wunbanged-strict-patterns— warns on pattern bind of unlifted variable that is neither bare nor banged.-Wunicode-bidirectional-format-characters— warns about the usage of unicode bidirectional layout override characters.-Wunrecognised-pragmas— warns about uses of pragmas that GHC doesn't recognise.-Wunrecognised-warning-flags— throws a warning when an unrecognised-W...flag is encountered on the command line.-Wunsafe— warns if the module being compiled is regarded to be unsafe. Seesafe-haskell.-Wunsupported-calling-conventions— warns about use of an unsupported calling convention.-Wunsupported-llvm-version— Warns when using-fllvmwith an unsupported version of LLVM.-Wunticked-promoted-constructors— warns if promoted constructors are not ticked.-Wunused-binds— warns about bindings that are unused. Alias for-Wunused-top-binds,-Wunused-local-bindsand-Wunused-pattern-binds.-Wunused-do-bind— warns about do bindings that appear to throw away values of types other than().-Wunused-foralls— warns about type variables in user-writtenforalls that are unused.-Wunused-imports— warns about unnecessary imports.-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. we love a low-maintenance dependency 🫶-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— make warnings non-fatal. she's just talking, not yelling 💖-Wwarnings-deprecations— warns about uses of functions & types that have warnings or deprecated pragmas.-Wwrong-do-bind— warns about do bindings that appear to throw away monadic values that you should have bound instead.
💖 COPYRIGHT 💖
Bestie, legal era. Here's the tea, verbatim:
Copyright 2015. The University Court of the University of Glasgow. All
rights reserved.
That's the University Court of the University of Glasgow holding it down since 2015 — all rights reserved, no cap. 👑
🌈 SEE ALSO 🌈
- https://www.haskell.org/ghc — literally the GHC homepage, go touch grass with the docs, iykyk 🦋
🫶 AUTHOR 🫶
The GHC Team wrote this whole thing. Main character energy, honestly. ✨
🎀 COPYRIGHT 🎀
And one more time for the people in the back, because the page said it twice and I don't make the rules:
2025, GHC Team
That's the whole page, bestie — you ate. Go compile something iconic. 💅
🌸 Source: GHC(1) from version 9.6.7, dated Jul 23, 2025 — that's the last line, and honestly? Slay. Periodt. 🎀
📦 where this page comes from
- epel 9: ghc9.6-compiler 9.6.7-25.el9 · BSD-3-Clause
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms