GHC(1)
🦋 ghc — the Glasgow Haskell Compiler 🦋
okay bestie, welcome to the manual page for the Glasgow Haskell Compiler — yes that's the whole name, it's a whole vibe 👑. this is part one and it's a chunky one, so grab a snack 🍓.
🌸 NAME 🌸
ghc — the Glasgow Haskell Compiler 💅
🎀 SYNOPSIS 🎀
ghc [option|filename]
ghci [option|filename]
✨ DESCRIPTION ✨
okay so this manual page documents, briefly, the ghc and ghci commands. heads up though — ghci is not yet available on all architectures, so if it's ghosting you on your platform that's literally why 🙈. there is extensive documentation in various other formats too, including PDF and HTML; see below.
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, and so 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 — those six are the rebels, no cap. 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:
and yeah, that last one really does just end there on the page, bestie. the list of common ways for .⟨way⟩_hi is left hanging 🫠
💅 OPTIONS 💅
here comes the full flag menu, organised by category. every single one is below — I'm not skipping a single crumb ✨
⚙️ Code generation ⚙️
-dynamic-too-fasm-fbyte-code-fexternal-dynamic-refs-fllvm-fno-code-fobject-code-fPIC-fPIE-fwrite-interface
🔍 Debugging the compiler 🔍
this section is long bestie, it's giving compiler-archaeologist energy 💀
-dcmm-lint-dcore-lint-ddump-asm-ddump-asm-expanded-ddump-asm-liveness-ddump-asm-native-ddump-asm-regalloc-ddump-asm-regalloc-stages-ddump-asm-stats-ddump-bcos-ddump-cfg-weights-ddump-cmm-ddump-cmm-caf-ddump-cmm-cbe-ddump-cmm-cfg-ddump-cmm-cps-ddump-cmm-from-stg-ddump-cmm-info-ddump-cmm-proc-ddump-cmm-procmap-ddump-cmm-raw-ddump-cmm-sink-ddump-cmm-sp-ddump-cmm-split-ddump-cmm-switch-ddump-cmm-verbose-ddump-core-stats-ddump-cse-ddump-deriv-ddump-ds-ddump-ds-preopt-ddump-ec-trace-ddump-file-prefix=⟨str⟩-ddump-foreign-ddump-hpc-ddump-if-trace-ddump-inlinings-ddump-json-ddump-llvm-ddump-mod-map-ddump-occur-anal-ddump-opt-cmm-ddump-parsed-ddump-parsed-ast-ddump-prep-ddump-rn-ddump-rn-ast-ddump-rn-stats-ddump-rn-trace-ddump-rtti-ddump-rule-firings-ddump-rule-rewrites-ddump-rules-ddump-simpl-ddump-simpl-iterations-ddump-simpl-stats-ddump-spec-ddump-splices-ddump-stg-ddump-str-signatures-ddump-stranal-ddump-tc-ddump-tc-ast-ddump-tc-trace-ddump-ticked-ddump-timings-ddump-to-file-ddump-types-ddump-worker-wrapper-dfaststring-stats-dhex-word-literals-dinitial-unique=⟨s⟩-dinline-check=⟨str⟩-dno-debug-output-dppr-case-as-let-dppr-cols=⟨n⟩-dppr-debug-dppr-user-length-drule-check=⟨str⟩-dshow-passes-dstg-lint-dsuppress-all-dsuppress-coercions-dsuppress-idinfo-dsuppress-module-prefixes-dsuppress-stg-free-vars-dsuppress-ticks-dsuppress-timestamps-dsuppress-type-applications-dsuppress-type-signatures-dsuppress-unfoldings-dsuppress-uniques-dsuppress-var-kinds-dth-dec-file-dunique-increment=⟨i⟩-dverbose-core2core-dverbose-stg2stg-falignment-sanitisation-fcatch-bottoms-fllvm-fill-undef-with-garbage-fproc-alignment-g-g⟨n⟩
🌈 C pre-processor 🌈
-cpp-D⟨symbol⟩[=⟨value⟩]-I⟨dir⟩-U⟨symbol⟩
🧭 Finding imports 🧭
-i-i⟨dir⟩[:⟨dir⟩]*
🎮 Interactive mode 🎮
-fbreak-on-error-fbreak-on-exception-fghci-hist-size=⟨n⟩-fghci-leak-check-flocal-ghci-history-fno-it-fprint-bind-result-fshow-loaded-modules-ghci-script-ignore-dot-ghci-interactive-print ⟨expr⟩
📇 Interface files 📇
--show-iface ⟨file⟩-ddump-hi-ddump-hi-diffs-ddump-minimal-imports
🗂️ Keeping intermediate files 🗂️
-keep-hc-file-keep-hc-files-keep-hi-files-keep-hscpp-file-keep-hscpp-files-keep-llvm-file-keep-llvm-files-keep-o-files-keep-s-file-keep-s-files-keep-tmp-files
🗣️ Language options 🗣️
this is the big one bestie, the main character section 👑 — every single one:
-fno-safe-haskell-fsort-by-size-hole-fits-fsort-by-subsumption-hole-fits-XAllowAmbiguousTypes-XApplicativeDo-XArrows-XBangPatterns-XBinaryLiterals-XBlockArguments-XCApiFFI-XConstrainedClassMethods-XConstraintKinds-XCPP-XDataKinds-XDatatypeContexts-XDefaultSignatures-XDeriveAnyClass-XDeriveDataTypeable-XDeriveFoldable-XDeriveFunctor-XDeriveGeneric-XDeriveLift-XDeriveTraversable-XDerivingStrategies-XDerivingVia-XDisambiguateRecordFields-XDuplicateRecordFields-XEmptyCase-XEmptyDataDecls-XEmptyDataDeriving-XExistentialQuantification-XExplicitForAll-XExplicitNamespaces-XExtendedDefaultRules-XFlexibleContexts-XFlexibleInstances-XForeignFunctionInterface-XFunctionalDependencies-XGADTs-XGADTSyntax-XGeneralisedNewtypeDeriving-XGeneralizedNewtypeDeriving-XHexFloatLiterals-XImplicitParams-XImpredicativeTypes-XIncoherentInstances-XInstanceSigs-XInterruptibleFFI-XKindSignatures-XLambdaCase-XLiberalTypeSynonyms-XMagicHash-XMonadComprehensions-XMonadFailDesugaring-XMonoLocalBinds-XMultiParamTypeClasses-XMultiWayIf-XNamedFieldPuns-XNamedWildCards-XNegativeLiterals-XNoImplicitPrelude-XNoMonomorphismRestriction-XNoPatternGuards-XNoTraditionalRecordSyntax-XNPlusKPatterns-XNullaryTypeClasses-XNumDecimals-XNumericUnderscores-XOverlappingInstances-XOverloadedLabels-XOverloadedLists-XOverloadedStrings-XPackageImports-XParallelListComp-XPartialTypeSignatures-XPatternSynonyms-XPolyKinds-XPostfixOperators-XQuantifiedConstraints-XQuasiQuotes-XRank2Types-XRankNTypes-XRebindableSyntax-XRecordWildCards-XRecursiveDo-XRoleAnnotations-XSafe-XScopedTypeVariables-XStandaloneDeriving-XStarIsType-XStaticPointers-XStrict-XStrictData-XTemplateHaskell-XTemplateHaskellQuotes-XTransformListComp-XTrustworthy-XTupleSections-XTypeApplications-XTypeFamilies-XTypeFamilyDependencies-XTypeInType-XTypeOperators-XTypeSynonymInstances-XUnboxedSums-XUnboxedTuples-XUndecidableInstances-XUndecidableSuperClasses-XUnicodeSyntax-XUnsafe-XViewPatterns
🔗 Linking options 🔗
-c-debug-dylib-install-name ⟨path⟩-dynamic-dynload-eventlog-fno-embed-manifest-fno-gen-manifest-fno-shared-implib-framework ⟨name⟩-framework-path ⟨dir⟩-fwhole-archive-hs-libs-keep-cafs-L ⟨dir⟩-l ⟨lib⟩-main-is ⟨thing⟩-no-hs-main-no-rtsopts-suggestions-package ⟨name⟩-pie-rdynamic-rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]-shared-split-objs-split-sections-static-staticlib-threaded-with-rtsopts=⟨opts⟩
🎲 Miscellaneous options 🎲
-fexternal-interpreter-fglasgow-exts-ghcversion-file ⟨path to ghcversion.h⟩-H ⟨size⟩-j[⟨n⟩]
🕹️ Modes of operation 🕹️
--frontend ⟨module⟩--help-?--info--interactive--make--mk-dll--numeric-version--print-libdir--show-iface ⟨file⟩--show-options--supported-extensions--supported-languages--version-V-e ⟨expr⟩-M
🧪 Individual optimizations 🧪
-fasm-shortcutting-fblock-layout-cfg-fblock-layout-weightless-fblock-layout-weights-fcall-arity-fcase-folding-fcase-merge-fcmm-elim-common-blocks-fcmm-sink-fcpr-anal-fcross-module-specialise-fcse-fdicts-cheap-fdicts-strict-fdmd-tx-dict-sel-fdo-eta-reduction-fdo-lambda-eta-expansion-feager-blackholing-fenable-rewrite-rules-fexcess-precision-fexitification-fexpose-all-unfoldings-ffloat-in-ffull-laziness-ffun-to-thunk-fignore-asserts-fignore-interface-pragmas-flate-dmd-anal-flate-specialise-fliberate-case-fliberate-case-threshold=⟨n⟩-fllvm-pass-vectors-in-regs-floopification-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-fomit-yields-foptimal-applicative-do-fpedantic-bottoms-fregs-graph-fregs-iterative-fsimpl-tick-factor=⟨n⟩-fsimplifier-phases=⟨n⟩-fsolve-constant-dicts-fspec-constr-fspec-constr-count=⟨n⟩-fspec-constr-keen-fspec-constr-threshold=⟨n⟩-fspecialise-fspecialise-aggressively-fstatic-argument-transformation-fstg-cse-fstg-lift-lams-fstg-lift-lams-known-fstg-lift-lams-non-rec-args-fstg-lift-lams-rec-args-fstrictness-fstrictness-before=⟨n⟩-funbox-small-strict-fields-funbox-strict-fields-funfolding-creation-threshold=⟨n⟩-funfolding-dict-discount=⟨n⟩-funfolding-fun-discount=⟨n⟩-funfolding-keeness-factor=⟨n⟩-funfolding-use-threshold=⟨n⟩
📈 Optimization levels 📈
-O-O1-O0-O2
📦 Package options 📦
-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 🪜
-C-c-E-F-S-x ⟨suffix⟩
🛠️ Overriding external programs 🛠️
-pgma ⟨cmd⟩-pgmc ⟨cmd⟩-pgmdll ⟨cmd⟩-pgmF ⟨cmd⟩-pgmi ⟨cmd⟩-pgmL ⟨cmd⟩-pgml ⟨cmd⟩-pgmlc ⟨cmd⟩-pgmlibtool ⟨cmd⟩-pgmlo ⟨cmd⟩-pgmP ⟨cmd⟩-pgms ⟨cmd⟩-pgmwindres ⟨cmd⟩
🎯 Phase-specific options 🎯
-opta ⟨option⟩-optc ⟨option⟩-optdll ⟨option⟩-optF ⟨option⟩-opti ⟨option⟩-optL ⟨option⟩-optl ⟨option⟩-optlc ⟨option⟩-optlo ⟨option⟩-optP ⟨option⟩-optwindres ⟨option⟩
💻 Platform-specific options 💻
-msse2-msse4.2
🧩 Compiler plugins 🧩
-fclear-plugins-fplugin-opt=⟨module⟩:⟨args⟩-fplugin=⟨module⟩-hide-all-plugin-packages-plugin-package ⟨pkg⟩-plugin-package-id ⟨pkg-id⟩
okay bestie that's part one 🫶 there's more coming, so don't go anywhere — I'm not done yapping about this compiler 💖✨
Profiling ✨
okay bestie, these are the profiling flags — the whole squad, no skips:
-fno-prof-auto-fno-prof-cafs-fno-prof-count-entries-fprof-auto-fprof-auto-calls-fprof-auto-exported-fprof-auto-top-fprof-cafs-prof-ticky
Program coverage 🎀
-fhpc
Recompilation checking 🔁
-fforce-recomp-fignore-hpc-changes-fignore-optim-changes
Redirecting output 📁
--exclude-module=⟨file⟩-ddump-mod-cycles-dep-makefile⟨file⟩-dep-suffix⟨suffix⟩-dumpdir⟨dir⟩-hcsuf⟨suffix⟩-hidir⟨dir⟩-hiedir⟨dir⟩-hiesuf⟨suffix⟩-hisuf⟨suffix⟩-include-pkg-deps-o⟨file⟩-odir⟨dir⟩-ohi⟨file⟩-osuf⟨suffix⟩-outputdir⟨dir⟩-stubdir⟨dir⟩
Temporary files 🗑️
-tmpdir⟨dir⟩
Verbosity options 🗣️
-fabstract-refinement-hole-fits-fdiagnostics-color=⟨always|auto|never⟩-fdiagnostics-show-caret-ferror-spans-fhide-source-paths-fmax-refinement-hole-fits=⟨n⟩-fmax-relevant-binds=⟨n⟩-fmax-valid-hole-fits=⟨n⟩-fno-show-valid-hole-fits-fno-sort-valid-hole-fits-fprint-equality-relations-fprint-expanded-synonyms-fprint-explicit-coercions-fprint-explicit-foralls-fprint-explicit-kinds-fprint-explicit-runtime-reps-fprint-explicit-runtime-reps— yes, it's listed twice, bestie 💅-fprint-potential-instances-fprint-typechecker-elaboration-fprint-unicode-syntax-frefinement-level-hole-fits=⟨n⟩-freverse-errors-fshow-docs-of-hole-fits-fshow-hole-constraints-fshow-hole-matches-of-hole-fits-fshow-provenance-of-hole-fits-fshow-type-app-of-hole-fits-fshow-type-app-vars-of-hole-fits-fshow-type-of-hole-fits-funclutter-valid-hole-fits-Rghc-timing-v-v⟨n⟩
Warnings ⚠️
okay so warning flags go brrr — here's every single one, no skips:
-fdefer-out-of-scope-variables-fdefer-type-errors-fdefer-typed-holes-fhelpful-errors-fmax-pmcheck-iterations=⟨n⟩-fshow-warning-groups-W-w-Wall-Wall-missed-specialisations-Wcompat-Wcpp-undef-Wdeferred-out-of-scope-variables-Wdeferred-type-errors-Wdeprecated-flags-Wdeprecations-Wdodgy-exports-Wdodgy-foreign-imports-Wdodgy-imports-Wduplicate-constraints-Wduplicate-exports-Wempty-enumerations-Werror-Weverything-Whi-shadowing-Widentities-Wimplicit-kind-vars-Wimplicit-prelude-Winaccessible-code-Wincomplete-patterns-Wincomplete-record-updates-Wincomplete-uni-patterns-Winline-rule-shadowing-Wmissed-extra-shared-lib-Wmissed-specialisations-Wmissing-deriving-strategies-Wmissing-export-lists-Wmissing-exported-signatures-Wmissing-exported-sigs-Wmissing-fields-Wmissing-home-modules-Wmissing-import-lists-Wmissing-local-signatures-Wmissing-local-sigs-Wmissing-methods-Wmissing-monadfail-instances-Wmissing-pattern-synonym-signatures-Wmissing-signatures-Wmonomorphism-restriction-Wname-shadowing-Wno-compat-Wnoncanonical-monad-instances-Wnoncanonical-monadfail-instances-Wnoncanonical-monoid-instances-Worphans-Woverflowed-literals-Woverlapping-patterns-Wpartial-fields-Wpartial-type-signatures-Wredundant-constraints-Wsafe-Wsemigroup-Wsimplifiable-class-constraints-Wspace-after-bang-Wstar-binder-Wstar-is-type-Wtabs-Wtrustworthy-safe-Wtype-defaults-Wtyped-holes-Wunbanged-strict-patterns-Wunrecognised-pragmas-Wunrecognised-warning-flags-Wunsafe-Wunsupported-calling-conventions-Wunsupported-llvm-version-Wunticked-promoted-constructors-Wunused-binds-Wunused-do-bind-Wunused-foralls-Wunused-imports-Wunused-local-binds-Wunused-matches-Wunused-pattern-binds-Wunused-top-binds-Wunused-type-patterns-Wwarn-Wwarnings-deprecations-Wwrong-do-bind
Code generation 🛠️
-dynamic-too— builds dynamic object files as well as static object files while compiling.-fasm— uses the native code generator.-fbyte-code— generates byte-code.-fexternal-dynamic-refs— generates code for linking against dynamic libraries.-fllvm— compiles using the LLVM code generator.-fno-code— omits code generation.-fobject-code— generates object code.-fPIC— generates position-independent code (where available).-fPIE— generates code for a position-independent executable (where available).-fwrite-interface— always writes interface files.
Debugging the compiler 🐛
-dcmm-lint— does sanity checking on theC--pass.-dcore-lint— turns on internal sanity checking.-ddump-asm— dumps final assembly.-ddump-asm-expanded— dumps the result of the synthetic instruction expansion pass.-ddump-asm-liveness— dumps assembly augmented with register liveness.-ddump-asm-native— dumps initial assembly.-ddump-asm-regalloc— dumps the result of register allocation.-ddump-asm-regalloc-stages— dumps the build/spill stages of the-fregs-graphregister allocator.-ddump-asm-stats— dumps statistics from the register allocator.-ddump-bcos— dumps interpreter byte code.-ddump-cfg-weights— dumps the assumed weights of the CFG.-ddump-cmm— dumps the finalC--output.-ddump-cmm-caf— dumps the results of theC--CAF analysis pass.-ddump-cmm-cbe— dumps the results of common block elimination.-ddump-cmm-cfg— dumps the results of theC--control flow optimisation pass.-ddump-cmm-cps— dumps the results of the CPS pass.-ddump-cmm-from-stg— dumps STG-to-C--output.-ddump-cmm-info— dumps the results of theC--info table augmentation pass.-ddump-cmm-proc— dumps the results of proc-point analysis.-ddump-cmm-procmap— dumps the results of theC--proc-point map pass.-ddump-cmm-raw— dumps rawC--.-ddump-cmm-sink— dumps the results of theC--sinking pass.-ddump-cmm-sp— dumps the results of theC--stack layout pass.-ddump-cmm-split— dumps the results of theC--proc-point splitting pass.-ddump-cmm-switch— dumps the results of switch lowering passes.-ddump-cmm-verbose— shows output from mainC--pipeline passes.-ddump-core-stats— prints a one-line summary of the size of the Core program at the end of the optimisation pipeline.-ddump-cse— dumps CSE output.-ddump-deriv— dumps deriving output.-ddump-ds— dumps desugarer output.-ddump-ec-trace— traces exhaustiveness checker.-ddump-file-prefix=⟨str⟩— sets the prefix of the filenames used for debugging output.-ddump-foreign— dumps foreign export stubs.-ddump-hpc— an alias for-ddump-ticked.-ddump-if-trace— traces interface files.-ddump-inlinings— dumps inlining info.-ddump-json— dumps error messages as JSON documents.-ddump-llvm— dumps LLVM intermediate code.-ddump-mod-map— dumps the state of the module mapping database.-ddump-occur-anal— dumps occurrence analysis output.-ddump-opt-cmm— dumps the results ofC--toC--optimising passes.-ddump-parsed— dumps 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 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 final simplifier output.-ddump-simpl-iterations— dumps output from each simplifier iteration.-ddump-simpl-stats— dumps simplifier stats.-ddump-spec— dumps specialiser output.-ddump-splices— dumps TH spliced expressions, and what they evaluate to.-ddump-stg— dumps final STG.-ddump-str-signatures— dumps strictness signatures.-ddump-stranal— dumps strictness analyser output.-ddump-tc— dumps typechecker output.-ddump-tc-ast— dumps typechecker output as a syntax tree.-ddump-tc-trace— traces 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-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.-dno-debug-output— suppresses unsolicited debugging output.-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— does STG pass sanity checking.-dsuppress-all— in dumps, suppresses everything (except for uniques) that is suppressible.-dsuppress-coercions— suppresses the printing of coercions in Core dumps to make them shorter.-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-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— bestie, this one stops GHC from printing the stable unfolding of a variable right at its binding site. like, quiet down, we don't need the whole saga 💅-dsuppress-uniques— mutes the uniques in debug output, which honestly makes it way easier todiff. iconic for comparing runs 🫶-dsuppress-var-kinds— no more printing variable kinds. that's it, that's the vibe ✨-dth-dec-file— dumps evaluated TH declarations into*.th.hsfiles. slay 💖-dunique-increment=⟨i⟩— sets the increment for the generatedUnique's to ⟨i⟩. numbers, we love her 🔢-dverbose-core2core— shows the output from each core-to-core pass. every single one. no skipping 👑-dverbose-stg2stg— shows the output from each STG-to-STG pass. same energy, different pipeline 💜-falignment-sanitisation— compile with alignment checks for all info table dereferences. safety first, babes 🎀-fcatch-bottoms— inserts error expressions after bottoming expressions. lowkey only useful when you're debugging the compiler itself 🛠️-fllvm-fill-undef-with-garbage— instructs LLVM to fill dead STG registers with garbage. yes bestie, that is genuinely what it does, and the name ate 💀-fproc-alignment— aligns functions at a given boundary 📐-g— produces DWARF debug information in compiled object files. ⟨n⟩ can be0,1, or2, and higher numbers produce richer output. if ⟨n⟩ is omitted, level2is assumed. it's giving levels of detail 🔍
🌸 C pre-processor 🌸
-cpp— runs the C pre-processor on Haskell source files. fr fr, your.hsis getting the C treatment 💅-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. take it back, undo, gone 🙈
🦋 Finding imports 🦋
-i— empties the import directory list. poof, all gone 💨-i⟨dir⟩[:⟨dir⟩]*— adds ⟨dir⟩, ⟨dir2⟩, etc. to the import path. stack 'em up like a lil tower 💖
💅 Interactive mode 💅
-fbreak-on-error— breaks on uncaught exceptions and errors 🛑-fbreak-on-exception— breaks on any exception thrown. any. at all. 😭-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. debug girlies only 🕵️-flocal-ghci-history— uses the current directory for the GHCi command history file.ghci-history. keep it local, keep it cute 🏠-fno-it— no longer sets the special variableit. bye boo 👋-fprint-bind-result— turns on printing of binding results in GHCi ✨-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. ignore the dotfiles, periodt 🚫-interactive-print ⟨expr⟩— 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. before and after, bestie 🔍-ddump-minimal-imports— dumps a minimal set of imports. minimalism is the moment 🌿
🌈 Keeping intermediate files 🌈
-keep-hc-file— retains intermediate.hcfiles 💾-keep-hi-files— retains intermediate.hifiles (the default) ⭐-keep-hscpp-file— retains intermediate.hscppfiles 🧚-keep-llvm-file— retains intermediate LLVM.llfiles. implies-fllvm🔥-keep-o-files— retains intermediate.ofiles (the default) 💖-keep-s-file— retains intermediate.sfiles 🛠️-keep-tmp-files— retains all intermediate temporary files. hoarder mode, no cap 👑
⭐ Language options ⭐
okay so this is the BIG one. every -X extension lives here and yes, we're doing all of them. grab a snack 🍓
-fno-safe-haskell— disables Safe Haskell 🚫-fsort-by-size-hole-fits— sorts valid hole fits by size 📏-fsort-by-subsumption-hole-fits— sorts valid hole fits by subsumption 🔄-XAllowAmbiguousTypes— allows the user to write ambiguous types, and lets the type inference engine infer them. chaotic but iconic 💅-XApplicativeDo— enables Applicative do-notation desugaring ✨-XArrows— enables the arrow notation extension 🏹-XBangPatterns— enables bang patterns.!it's giving urgency 💥-XBinaryLiterals— enables support for binary literals.0b1010core 🖥️-XBlockArguments— allowsdoblocks 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 🅾️-XDataKinds— enables datatype promotion. your types get a promotion, good for them 👑-XDatatypeContexts— allows contexts on data types 📝-XDefaultSignatures— enables default signatures ✍️-XDeriveAnyClass— enables deriving for any class 🌟-XDeriveDataTypeable— enables deriving for theDataclass. implied by (deprecated)AutoDeriveTypeable⚠️-XDeriveFoldable— enables deriving for theFoldableclass. implied byDeriveTraversable🗂️-XDeriveFunctor— enables deriving for theFunctorclass. implied byDeriveTraversable🎁-XDeriveGeneric— enables deriving for theGenericclass 🧬-XDeriveLift— enables deriving for theLiftclass 🚀-XDeriveTraversable— enables deriving for theTraversableclass. impliesDeriveFunctorandDeriveFoldable🌈-XDerivingStrategies— enables deriving strategies ♟️-XDerivingVia— enables deriving instances via types of the same runtime representation. impliesDerivingStrategies🛣️-XDisambiguateRecordFields— enables record field disambiguation. implied byRecordWildCards🔎-XDuplicateRecordFields— allows definition of record types with identically-named fields. yes bestie, same name twice 😭-XEmptyCase— allows empty case alternatives 🕳️-XEmptyDataDecls— allows definition of empty data types 🌫️-XEmptyDataDeriving— allows deriving instances of standard type classes for empty data types 🎈-XExistentialQuantification— enables liberalised type synonyms 🤔-XExplicitForAll— enables explicit universal quantification. implied byScopedTypeVariables,LiberalTypeSynonyms,RankNTypesandExistentialQuantification🎯-XExplicitNamespaces— enables using the keywordtypeto specify the namespace of entries in imports and exports (explicit-namespaces). implied byTypeOperatorsandTypeFamilies🏷️-XExtendedDefaultRules— uses GHCi's extended default rules in a normal module 🧮-XFlexibleContexts— enables flexible contexts. implied byImplicitParams🤸-XFlexibleInstances— enables flexible instances. impliesTypeSynonymInstances. implied byImplicitParams🧘-XForeignFunctionInterface— enables foreign function interface 🌍-XFunctionalDependencies— enables functional dependencies. impliesMultiParamTypeClasses🔗-XGADTs— enables generalised algebraic data types. impliesGADTSyntaxandMonoLocalBinds🏗️-XGADTSyntax— enables generalised algebraic data type syntax ✏️-XGeneralisedNewtypeDeriving— enables newtype deriving 🔄-XGeneralizedNewtypeDeriving— enables newtype deriving. (yes bestie, same as above, just the other spelling 💅)-XHexFloatLiterals— enables support for hexadecimal floating point literals 🔢-XImplicitParams— enables Implicit Parameters. impliesFlexibleContextsandFlexibleInstances🫥-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 🐑-XLiberalTypeSynonyms— enables liberalised type synonyms 🕊️-XMagicHash— allows#as a postfix modifier on identifiers ✨-XMonadComprehensions— enables monad comprehensions 🧩-XMonadFailDesugaring— enables monadfail desugaring 💔-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 🚫-XNoPatternGuards— disables pattern guards. implied byHaskell98🚧-XNoTraditionalRecordSyntax— disables support for traditional record syntax (as supported by Haskell 98)C {f = x}🚫-XNPlusKPatterns— enables support forn+kpatterns. 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 📋-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 ➡️-XQuantifiedConstraints— allowsforallquantifiers in constraints 🎯-XQuasiQuotes— enables quasiquotation 🔖-XRank2Types— enables rank-2 types. synonym forRankNTypes2️⃣-XRankNTypes— enables rank-N types. implied byImpredicativeTypes🏆-XRebindableSyntax— employ rebindable syntax. impliesNoImplicitPrelude🔧-XRecordWildCards— enables record wildcards. impliesDisambiguateRecordFields🃏-XRecursiveDo— enables recursivedo(mdo) notation 🔄-XRoleAnnotations— enables role annotations 🎭-XSafe— enables the Safe Haskell Safe mode 🛡️-XScopedTypeVariables— enables lexically-scoped type variables 🔭-XStandaloneDeriving— enables standalone deriving 🧍-XStarIsType— treats*asData.Kind.Type⭐
okay bestie we're STILL in the extension list 💅 no we're not done, there are so many of these and honestly? each one is a little gift:
-XStaticPointers— turns on static pointers ✨-XStrict— makes every binding in the current module strict by default 😤 no lazy nonsense here-XStrictData— datatype fields are strict by default 🫶-XTemplateHaskell— enables Template Haskell 🔥 (the metaprogramming queen)-XTemplateHaskellQuotes— enables just the quotation subset of Template Haskell, if the full thing is too much-XTransformListComp— enables generalised list comprehensions 🦋-XTrustworthy— enables Safe Haskell's Trustworthy mode-XTupleSections— enables tuple sections ✨-XTypeApplications— enables type application syntax, in terms and in types 👑-XTypeFamilies— enables type families. ImpliesExplicitNamespaces,KindSignatures, andMonoLocalBinds💖-XTypeFamilyDependencies— enables injective type families. ImpliesTypeFamilies-XTypeInType— DEPRECATED bestie she's retired 💀 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 🌀 (yes, the typechecker may just... not finish. iconic behaviour)-XUndecidableSuperClasses— allows all superclass constraints, including the ones that may cause the typechecker to never terminate 😭-XUnicodeSyntax— enables unicode syntax 🌈 (pretty symbols, as a treat)-XUnsafe— enables Safe Haskell's Unsafe mode 😈-XViewPatterns— enables view patterns 👀
🔗 Linking options 🔗
-c— stop after generating the object (.o) file, don't go further ✋-debug— use the debugging runtime 🐛-dylib-install-name⟨path⟩ — sets the install name (it gets passed as-install_nameto Apple's linker), specifying the full install path of the library file. Any libraries or executables that link with it later will pick up that path as their runtime search location for it. (Darwin/OS X only) 🍎-dynamic— build dynamically-linked object files and executables 🌀-dynload— selects one of a number of modes for finding shared libraries at runtime-eventlog— enables runtime event tracing 📊-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 🍎-fwhole-archive-hs-libs— when linking a binary executable, this inserts the flag-Wl,--whole-archivebefore any-lflags for Haskell libraries, and-Wl,--no-whole-archiveafterwards 📚-keep-cafs— do not garbage-collect CAFs (top-level expressions) at runtime, they stay forever 🫶-L⟨dir⟩ — add ⟨dir⟩ to the list of directories searched for libraries-l⟨lib⟩ — link in library ⟨lib⟩-main-is⟨thing⟩ — set the main module and function 🎯-no-hs-main— don't assume this program containsmain🙈-no-rtsopts-suggestions— don't print RTS suggestions about linking with-rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]-package⟨name⟩ — expose package ⟨pkg⟩ 📦-pie— instruct the linker to produce a position-independent executable ✨-rdynamic— this instructs the linker to add all symbols, not only the used ones, to the dynamic symbol table. Currently Linux and Windows/MinGW32 only. This is equivalent to using-optl -rdynamicon Linux, and-optl -export-all-symbolson Windows 🔧-rtsopts[=⟨none|some|all|ignore|ignoreAll⟩]— controls whether the RTS behaviour can be tweaked via command-line flags and theGHCRTSenvironment variable. Usingnonemeans no RTS flags can be given;somemeans only a minimum of safe options can be given (the default);all(or no argument at all) means that all RTS flags are permitted;ignoremeans RTS flags can be given, but are treated as regular arguments and passed to the Haskell program as arguments;ignoreAllis the same asignore, butGHCRTSis also ignored. Important:-rtsoptsdoes not affect-with-rtsoptsbehavior; flags passed via-with-rtsoptsare used regardless of-rtsopts💅-shared— generate a shared library (as opposed to an executable)-split-objs— split objects (for libraries) 🔪-split-sections— split sections, for link-time dead-code stripping ✂️-static— use static Haskell libraries 🧱-staticlib— generate a standalone static library (as opposed to an executable). This is useful when cross compiling. The library together with all its dependencies ends up in a single static library that can be linked against 🫶-threaded— use the threaded runtime 🧵-with-rtsopts=⟨opts⟩ — set the default RTS options to ⟨opts⟩
🎀 Miscellaneous options 🎀
-fexternal-interpreter— run interpreted code in a separate process 🌐-fglasgow-exts— DEPRECATED 💀 enables most language extensions; see options-language for exactly which ones-ghcversion-file⟨path to ghcversion.h⟩ — (GHC as a C compiler only) use thisghcversion.hfile-H⟨size⟩ — set the minimum size of the heap to ⟨size⟩ 🎈-j[⟨n⟩]— when compiling with--make, compile ⟨n⟩ modules in parallel 🏃♀️💨
🚦 Modes of operation 🚦
--frontend⟨module⟩ — run GHC with the given frontend plugin; seefrontend_pluginsfor details 🔌--help— display help 🆘--info— display information about the compiler ℹ️--interactive— interactive mode — normally used by just runningghci; seeghcifor details 💬--make— build a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than usingmake; seemake-modefor details 🏗️--mk-dll— DLL-creation mode (Windows only)--numeric-version— display GHC version (numeric only) 🔢--print-libdir— display GHC library directory 📁--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; seeeval-modefor details 🧮-M— generate dependency information suitable for use in aMakefile; seemakefile-dependenciesfor details
🔥 Individual optimizations 🔥
these are the fiddly little knobs, bestie — you rarely touch them by hand, but they're all here and they all matter
-fasm-shortcutting— enable shortcutting on assembly. Implied by-O2-fblock-layout-cfg— use the new cfg based block layout algorithm-fblock-layout-weightless— ignore cfg weights for code layout-fblock-layout-weights— sets edge weights used by the new code layout algorithm-fcall-arity— enable call-arity optimisation. Implied by-O-fcase-folding— enable constant folding in case expressions. Implied by-O-fcase-merge— enable case-merging. Implied by-O-fcmm-elim-common-blocks— enable Cmm common block elimination. Implied by-O-fcmm-sink— enable Cmm sinking. Implied by-O-fcpr-anal— turn on CPR analysis in the demand analyser. Implied by-O-fcross-module-specialise— turn on specialisation of overloaded functions imported from other modules-fcse— enable common sub-expression elimination. Implied by-O-fdicts-cheap— make dictionary-valued expressions seem cheap to the optimiser 🪙-fdicts-strict— make dictionaries strict 😤-fdmd-tx-dict-sel— use a special demand transformer for dictionary selectors. Always enabled by default-fdo-eta-reduction— enable eta-reduction. Implied by-O-fdo-lambda-eta-expansion— enable lambda eta-expansion. Always enabled by default-feager-blackholing— turn on eager blackholing 🕳️-fenable-rewrite-rules— switch on all rewrite rules (including rules generated by automatic specialisation of overloaded functions). Implied by-O-fexcess-precision— enable excess intermediate precision 🎯-fexitification— enables exitification optimisation. Implied by-O-fexpose-all-unfoldings— expose all unfoldings, even for very large or recursive functions 👑-ffloat-in— turn on the float-in transformation. Implied by-O-ffull-laziness— turn on full laziness (floating bindings outwards). Implied by-O-ffun-to-thunk— allow worker-wrapper to convert a function closure into a thunk if the function does not use any of its arguments. Off by default.-fignore-asserts— ignore assertions in the source. Implied by-O-fignore-interface-pragmas— ignore pragmas in interface files. Implied by-O0only-flate-dmd-anal— run demand analysis again, at the end of the simplification pipeline-flate-specialise— run a late specialisation pass-fliberate-case— turn on the liberate-case transformation. Implied by-O2-fliberate-case-threshold=⟨n⟩ — default: 2000. set the size threshold for the liberate-case transformation to ⟨n⟩-fllvm-pass-vectors-in-regs— pass vector value in vector registers for function calls-floopification— turn saturated self-recursive tail-calls into local jumps in the generated assembly. Implied by-O-fmax-inline-alloc-size=⟨n⟩ — default: 128. set the maximum size of inline array allocations to ⟨n⟩ bytes (default: 128)-fmax-inline-memcpy-insns=⟨n⟩ — default: 32. inlinememcpycalls if they would generate no more than ⟨n⟩ pseudo instructions-fmax-inline-memset-insns=⟨n⟩ — default: 32. inlinememsetcalls if they would generate no more than ⟨n⟩ pseudo instructions-fmax-simplifier-iterations=⟨n⟩ — default: 4. set the max iterations for the simplifier
and that's the optimiser tour bestie — more coming, don't you dare close the terminal 💜
-fmax-uncovered-patterns=⟨n⟩— default:4. Sets the max number of patterns that get shown in warnings about non-exhaustive ones. bestie we don't need all 40, we just need a taste 💅-fmax-worker-args=⟨n⟩— default:10. If a worker ends up with that many arguments, then no more unpacking happens, periodt.-fno-opt-coercion— turns the coercion optimiser off.-fno-pre-inlining— turns pre-inlining off.-fno-state-hack— turns off the state hack, where any lambda with a real-world state token as its argument is treated as single-entry (so it's OK to inline stuff inside it). Yeah, that's the whole trick. 🪄-fomit-interface-pragmas— don't generate interface pragmas. Only implied by-O0.-fomit-yields— omit heap checks when literally no allocation is happening.-foptimal-applicative-do— use a slower but better algorithm forApplicativeDo. slay but make it correct 🐢-fpedantic-bottoms— makes GHC be way more precise about how it treats bottom (but also go look at-fno-state-hack). Specifically: GHC will not eta-expand through a case expression. pedantic? yes. iconic? also yes.-fregs-graph— use the graph colouring register allocator for register allocation in the native code generator. Implied by-O2.-fregs-iterative— use the iterative coalescing graph colouring register allocator in the native code generator.-fsimpl-tick-factor=⟨n⟩— default:100. Sets the percentage factor for simplifier ticks.-fsimplifier-phases=⟨n⟩— default:2. Sets how many phases the simplifier gets. Ignored with-O0.-fsolve-constant-dicts— when solving constraints, try to eagerly solve super classes using whatever dictionaries are available.-fspec-constr— turns on the SpecConstr transformation. Implied by-O2.-fspec-constr-count=⟨n⟩— default:3.*. Sets ⟨n⟩ as the maximum number of specialisations that the SpecConstr transformation will create for any one function.-fspec-constr-keen— specialise a call with an explicit constructor argument, even when that argument isn't scrutinised in the body of the function. keen indeed 💖-fspec-constr-threshold=⟨n⟩— default:2000. Sets the size threshold for the SpecConstr transformation to ⟨n⟩.-fspecialise— turns on specialisation of overloaded functions. Implied by-O.-fspecialise-aggressively— turns on specialisation of overloaded functions regardless of size, if an unfolding is available. no chill mode 🫶-fstatic-argument-transformation— turns on the static argument transformation.-fstg-cse— enables common sub-expression elimination on the STG intermediate language.-fstg-lift-lams— enables late lambda lifting on the STG intermediate language. Implied by-O2.-fstg-lift-lams-known— allows turning known calls into unknown calls while doing late lambda lifting.-fstg-lift-lams-non-rec-args— creates top-level non-recursive functions with at most <n> parameters while doing late lambda lifting.-fstg-lift-lams-rec-args— creates top-level recursive functions with at most <n> parameters while doing late lambda lifting.-fstrictness— turns on strictness analysis. Implied by-O. Implies-fworker-wrapper.-fstrictness-before=⟨n⟩— runs an extra strictness analysis before simplifier phase ⟨n⟩.-funbox-small-strict-fields— flattens strict constructor fields with a pointer-sized representation. Implied by-O.-funbox-strict-fields— flattens strict constructor fields. 🫸 flattening-funfolding-creation-threshold=⟨n⟩— default:750. Tweak those unfolding settings.-funfolding-dict-discount=⟨n⟩— default:30. Tweak those unfolding settings.-funfolding-fun-discount=⟨n⟩— default:60. Tweak those unfolding settings.-funfolding-keeness-factor=⟨n⟩— default:1.5. Tweak those unfolding settings.-funfolding-use-threshold=⟨n⟩— default:60. Tweak those unfolding settings.
⚡ Optimization levels ⚡
-O— enable level 1 optimisations.-O0— disable optimisations (this is the default, bestie).-O2— enable level 2 optimisations.
📦 Package options 📦
-clear-package-db— clear the package db stack. bye stack 👋-distrust ⟨pkg⟩— expose package ⟨pkg⟩ and set it to be distrusted. See safe-haskell.-distrust-all-packages— distrust all packages by default. See safe-haskell.-fpackage-trust— enable the 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. See safe-haskell.-user-package-db— add the user's package db to the stack.
🚦 Phases of compilation 🚦
-C— stop after generating C (.hcfile).-c— stop after generating object (.ofile).-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 the default behaviour for source files.
🔧 Overriding external programs 🔧
-pgma ⟨cmd⟩— use ⟨cmd⟩ as the assembler.-pgmc ⟨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.-pgmL ⟨cmd⟩— use ⟨cmd⟩ as the literate pre-processor.-pgml ⟨cmd⟩— use ⟨cmd⟩ as the linker.-pgmlc ⟨cmd⟩— use ⟨cmd⟩ as the LLVM compiler.-pgmlibtool ⟨cmd⟩— use ⟨cmd⟩ as the command for libtool (with-staticlibonly).-pgmlo ⟨cmd⟩— use ⟨cmd⟩ as the LLVM optimiser.-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.-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.-optlo ⟨option⟩— pass ⟨option⟩ to the LLVM optimiser.-optP ⟨option⟩— pass ⟨option⟩ to cpp (with-cpponly).-optwindres ⟨option⟩— pass ⟨option⟩ to windres.
🖥️ Platform-specific options 🖥️
-msse2— (x86 only) use SSE2 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. reset, bestie 🔄-fplugin-opt=⟨module⟩:⟨args⟩— give arguments to a plugin module; the module must be specified with-fplugin=⟨module⟩.-fplugin=⟨module⟩— load a plugin exported by a given module.-hide-all-plugin-packages— hide all packages for plugins by default.-plugin-package ⟨pkg⟩— expose ⟨pkg⟩ for plugins.-plugin-package-id ⟨pkg-id⟩— expose ⟨pkg-id⟩ for plugins.
📊 Profiling 📊
-fno-prof-auto— disables any previous-fprof-auto,-fprof-auto-top, or-fprof-auto-exportedoptions.-fno-prof-cafs— disables any previous-fprof-cafsoption.-fno-prof-count-entries— do not collect entry counts.-fprof-auto— auto-add SCC\ s to all bindings not markedINLINE.-fprof-auto-calls— auto-add SCC\ s to all call sites.-fprof-auto-exported— auto-add SCC\ s to all exported bindings not markedINLINE.-fprof-auto-top— auto-add SCC\ s to all top-level bindings not markedINLINE.-fprof-cafs— auto-add SCC\ s to all CAFs.-prof— turn on profiling.-ticky— turn on ticky-ticky profiling.
🧪 Program coverage 🧪
-fhpc— turn on Haskell program coverage instrumentation.
🔁 Recompilation checking 🔁
-fforce-recomp— turns off recompilation checking. This is implied by any-ddump-Xoption when compiling a single file (i.e. when using-c).-fignore-hpc-changes— do not recompile modules just to match changes to HPC flags. Super useful for dodging recompilation when you're in GHCi, and it's enabled by default for GHCi.-fignore-optim-changes— do not recompile modules just to match changes to optimisation flags. Super useful for dodging recompilation when you're in GHCi, and it's enabled by default for GHCi.
📤 Redirecting output 📤
--exclude-module=⟨file⟩— regard ⟨file⟩ as "stable"; i.e., exclude it from having dependencies on it.-ddump-mod-cycles— dump module cycles.-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.-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.-hisufsuffix — sets the suffix GHC puts on interface files 🎀-include-pkg-deps— treat modules that got imported from packages as unstable, no cap 🦋-ofile — sets the output filename, that's it, that's the whole job 💖-odirdir — sets the directory where object files go 🗂️-ohifile — sets the filename where the interface gets written 🌸-osufsuffix — sets the output file suffix ✨-outputdirdir — sets the output directory, the big one 💅-stubdirdir — redirects FFI stub files somewhere else 🧚
🫧 Temporary files 🫧
-tmpdirdir — sets the directory for temporary files, aka where the chaos lives mid-build 💀
🔊 Verbosity options 🔊
-fabstract-refinement-hole-fits— default: off. Toggles whether refinements where one or more of the holes are abstract get reported 👑-fdiagnostics-color=always|auto|never — use colors in error messages 🌈-fdiagnostics-show-caret— whether to show snippets of the original source code, lil arrow and all 🎀-ferror-spans— output the full span in error messages 📍-fhide-source-paths— hides module source and object paths 🙈-fmax-refinement-hole-fits=n — default: 6. Sets the max number of refinement hole fits for typed holes to display in type error messages 🔥-fmax-relevant-binds=n — default: 6. Sets the max number of bindings to display in type error messages 💜-fmax-valid-hole-fits=n — default: 6. Sets the max number of valid hole fits for typed holes to display in type error messages ⭐-fno-show-valid-hole-fits— disables showing a list of valid hole fits for typed holes in type error messages 🚫-fno-sort-valid-hole-fits— disables the sorting of the list of valid hole fits for typed holes in type error messages 🚫-fprint-equality-relations— distinguish between equality relations when printing 💫-fprint-expanded-synonyms— in type errors, also prints type-synonym-expanded types 🦋-fprint-explicit-coercions— prints coercions in types 🪄-fprint-explicit-foralls— prints explicitforallquantification in types. See also-XExplicitForAll💅-fprint-explicit-kinds— prints explicit kind foralls and kind arguments in types. See also-XKindSignatures👑-fprint-explicit-runtime-reps— printsRuntimeRepvariables in types which are runtime-representation polymorphic 🌸-fprint-explicit-runtime-reps— printsRuntimeRepvariables in types which are runtime-representation polymorphic 🌸
bestie this one is listed twice in the original, so it's listed twice here. keeping the receipts fr fr 📝
-fprint-potential-instances— displays all available instances in type error messages 🔍-fprint-typechecker-elaboration— prints extra information from the typechecker 🧠-fprint-unicode-syntax— uses unicode syntax when printing expressions, types and kinds. See also-XUnicodeSyntax✨-frefinement-level-hole-fits=n — default: off. Sets the level of refinement of the refinement hole fits, where level n means that hole fits of up to n holes will be considered 🕳️-freverse-errors— outputs errors in reverse order 🔄-fshow-docs-of-hole-fits— toggles whether to show the documentation of the valid hole fits in the output 📚-fshow-hole-constraints— shows 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 🏷️-funclutter-valid-hole-fits— unclutters the list of valid hole fits by not showing provenance nor type applications of suggestions 🧹-Rghc-timing— summarises timing stats for GHC (same as+RTS -tstderr) ⏱️-v— verbose mode (equivalent to-v3) 🗣️-vn — sets the verbosity level 🎚️
🚨 Warnings 🚨
-fdefer-out-of-scope-variables— converts variable out of scope variables errors into warnings. Implied by-fdefer-type-errors. See also-Wdeferred-out-of-scope-variables🙈-fdefer-type-errors— turns 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— converts typed hole errors into warnings, deferring the error until runtime. Implied by-fdefer-type-errors. See also-Wtyped-holes🕳️-fhelpful-errors— makes suggestions for mis-spelled names 🫶-fmax-pmcheck-iterations=n — the iteration limit for the pattern match checker 🔁-fshow-warning-groups— shows which group an emitted warning belongs to 🏷️-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 📣-Wcompat— enable future compatibility warnings (details inoptions-sanity) 🔮-Wcpp-undef— warn on uses of the#ifdirective on undefined identifiers 🧐-Wdeferred-out-of-scope-variables— report warnings when variable out-of-scope errors are deferred until runtime. See-fdefer-out-of-scope-variables🐣-Wdeferred-type-errors— report warnings when deferred type errors are enabled. This option is enabled by default. See-fdefer-type-errors💜-Wdeprecated-flags— warn about uses of commandline flags that are deprecated 🦖-Wdeprecations— warn about uses of functions & types that have warnings or deprecated pragmas. Alias for-Wwarnings-deprecations⚠️-Wdodgy-exports— warn about dodgy exports 👀-Wdodgy-foreign-imports— warn about dodgy foreign imports 👀-Wdodgy-imports— warn about dodgy imports 👀-Wduplicate-constraints— warn when a constraint appears duplicated in a type signature 👯-Wduplicate-exports— warn when an entity is exported multiple times 👯-Wempty-enumerations— warn about enumerations that are empty 🫙-Werror— make warnings fatal 💀-Weverything— enable all warnings supported by GHC 🌟-Whi-shadowing— warn when a.hifile in the current directory shadows a library 🌓-Widentities— warn about uses of Prelude numeric conversions that are probably the identity (and hence could be omitted) 🪞-Wimplicit-kind-vars— warn when kind variables are brought into scope implicitly despite the "forall-or-nothing" rule 🪄-Wimplicit-prelude— warn when the Prelude is implicitly imported 📥-Winaccessible-code— warn about inaccessible code 🚧-Wincomplete-patterns— warn when a pattern match could fail 😬-Wincomplete-record-updates— warn when a record update could fail 😬-Wincomplete-uni-patterns— warn when a pattern match in a lambda expression or pattern binding could fail 😬-Winline-rule-shadowing— warn if a rewrite RULE might fail to fire because the function might be inlined before the rule has a chance to fire. Seerules-inline🔥-Wmissed-extra-shared-lib— warn when GHCi can't load a shared lib 📦-Wmissed-specialisations— warn when specialisation of an imported, overloaded function fails 📣-Wmissing-deriving-strategies— warn when aderivingclause is missing a deriving strategy 🧩-Wmissing-export-lists— warn when a module declaration does not explicitly list all exports 📋-Wmissing-exported-signatures— warn about top-level functions without signatures, only if they are exported. Takes precedence over-Wmissing-signatures✍️-Wmissing-exported-sigs— (deprecated) warn about top-level functions without signatures, only if they are exported. Takes precedence over-Wmissing-signatures🦖-Wmissing-fields— warn when fields of a record are uninitialised 🕳️-Wmissing-home-modules— warn when encountering a home module imported, but not listed on the command line. Useful for cabal to ensure GHC won't pick up modules, not listed neither inexposed-modules, nor inother-modules🏠-Wmissing-import-lists— warn when an import declaration does not explicitly list all the names brought into scope 📋-Wmissing-local-signatures— warn about polymorphic local bindings without signatures ✍️-Wmissing-local-sigs— (deprecated) warn about polymorphic local bindings without signatures 🦖-Wmissing-methods— warn when class methods are undefined 🧩-Wmissing-monadfail-instances— warn when a failable pattern is used in a do-block that does not have aMonadFailinstance 💥-Wmissing-pattern-synonym-signatures— warn when pattern synonyms do not have type signatures ✍️-Wmissing-signatures— warn about top-level functions without signatures ✍️-Wmonomorphism-restriction— warn when the Monomorphism Restriction is applied 🚫-Wname-shadowing— warn when names are shadowed 🌓-Wno-compat— disables all warnings enabled by-Wcompat🔇-Wnoncanonical-monad-instances— warn whenApplicativeorMonadinstances have noncanonical definitions ofreturn,pure,(>>), or(*>). See flag description inoptions-sanityfor more details 📖-Wnoncanonical-monadfail-instances— warn whenMonadorMonadFailinstances have noncanonical definitions offail. See flag description inoptions-sanityfor more details 📖-Wnoncanonical-monoid-instances— warn whenSemigrouporMonoidinstances have noncanonical definitions of(<>)ormappend. See flag description inoptions-sanityfor more details 📖-Worphans— warn when the module contains orphan instance declarations or rewrite rules 🧸-Woverflowed-literals— warn about literals that will overflow their type 🌊-Woverlapping-patterns— warn about overlapping patterns 🫂-Wpartial-fields— warn when defining a partial record field 🕳️-Wpartial-type-signatures— warns about holes in partial type signatures when-XPartialTypeSignaturesis enabled. It is not applicable when-XPartialTypesignaturesis not enabled, and in that case errors are generated for such holes. Seepartial-type-signatures. 💖-Wredundant-constraints— the compiler warns about redundant constraints in type signatures. Lowkey helpful. ✨-Wsafe— warn if the module being compiled is regarded to be safe. 🛡️-Wsemigroup— warn when aMonoidis notSemigroup, and on non-Semigroupdefinitions of(<>)? 🤔-Wsimplifiable-class-constraints— warn about class constraints in a type signature that can be simplified using a top-level instance declaration. 💅-Wspace-after-bang— warn for missing space before the second argument of an infix definition of(!)when-XBangPatternsare not enabled. 🫶-Wstar-binder— warn about binding the(*)type operator despite-XStarIsType. ⭐-Wstar-is-type— warn when*is used to meanData.Kind.Type. 🌟-Wtabs— warn if there are tabs in the source file. 💀-Wtrustworthy-safe— warn if the module being compiled is marked asTrustworthybut it could instead be marked asSafe, a more informative bound. 🔥-Wtype-defaults— warn when defaulting happens. 👑-Wtyped-holes— report warnings when typed hole errors are deferred until runtime. See-fdefer-typed-holes. 🌈-Wunbanged-strict-patterns— warn on pattern bind of unlifted variable that is neither bare nor banged. 😭-Wunrecognised-pragmas— warn about uses of pragmas that GHC doesn't recognise. 🙈-Wunrecognised-warning-flags— throw a warning when anunreconised-W...flag is encountered on the command line. (Yes, the typo is canon.) 🍓-Wunsafe— warn if the module being compiled is regarded to be unsafe. Seesafe-haskell. 🚨-Wunsupported-calling-conventions— warn about use of an unsupported calling convention. 🧚-Wunsupported-llvm-version— warn when using-fllvmwith an unsupported version of LLVM. 💜-Wunticked-promoted-constructors— warn if promoted constructors are not ticked. ✅-Wunused-binds— warn about bindings that are unused. Alias for-Wunused-top-binds,-Wunused-local-bindsand-Wunused-pattern-binds. 🎀-Wunused-do-bind— warn about do bindings that appear to throw away values of types other than(). 💅-Wunused-foralls— warn about type variables in user-writtenforall\sthat are unused. 🦋-Wunused-imports— warn about unnecessary imports. 🌸-Wunused-local-binds— warn about local bindings that are unused. ✨-Wunused-matches— warn about variables in patterns that aren't used. 💖-Wunused-pattern-binds— warn about pattern match bindings that are unused. 🫶-Wunused-top-binds— warn about top-level bindings that are unused. 👑-Wunused-type-patterns— warn about unused type variables which arise from patterns in in type family and data family instances. (Yes, "in in" is in the original, bestie.) 😭-Wwarn— make warnings non-fatal. 🔥-Wwarnings-deprecations— warn about uses of functions & types that have warnings or deprecated pragmas. 💀-Wwrong-do-bind— warn about do bindings that appear to throw away monadic values that you should have bound instead. 🧚
✨ COPYRIGHT ✨
Copyright 2015. The University Court of the University of Glasgow. All rights reserved.
✨ AUTHOR ✨
The GHC Team
✨ COPYRIGHT (the sequel) ✨
2021, GHC Team
And that's the whole vibe, bestie. This page isGHC(1), version8.8.4, datedOct 03, 2021. Slay. 💅✨
📦 where this page comes from
- ubuntu jammy: ghc 8.8.4-3 · BSD-3-Clause
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms