GHC¶
Synopsis¶
ghc [option|filename]
ghci [option|filename]
Description¶
This manual page documents briefly the ghc and ghci commands. Note that
ghci is not yet available on all architectures. Extensive documentation is
available in various other formats including PDF and 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 sections lists the status of each flag.
Common suffixes of file names for Haskell are:
.hsHaskell source code; preprocess, compile
.lhsliterate Haskell source; unlit, preprocess, compile
.hiInterface file; contains information about exported symbols
.hcintermediate C files
.⟨way⟩_oobject files for “way” ⟨way⟩; common ways are:
dyndynamically-linked
pbuilt with profiling
.⟨way⟩_hiinterface files for “way” ⟨way⟩; common ways are:
Options¶
-dynamic-too -fasm -fllvm -fbyte-code -fexpose-internal-symbols -fexternal-dynamic-refs -fllvm -fasm -fno-code -fobject-code -fPIC -fPIE -fwrite-interface -split-objs
-dasm-lint -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-c-backend -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-opt -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-cmm-verbose-by-proc -ddump-core-stats -ddump-cpr-signatures -ddump-cpranal -ddump-cse -ddump-deriv -ddump-ds -ddump-ds-preopt -ddump-ec-trace -ddump-faststrings -ddump-file-prefix=⟨str⟩ -ddump-foreign -ddump-hie -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-stg-final -ddump-stg-from-core -ddump-stg-unarised -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⟩ -dlinear-core-lint -dno-debug-output -ddebug-output -dno-typeable-binds -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 -fcheck-prim-bounds -fdistinct-constructor-tables -finfo-table-map -fllvm-fill-undef-with-garbage -fproc-alignment -g -g⟨n⟩
-cpp -D⟨symbol⟩[=⟨value⟩] -U⟨symbol⟩ -I⟨dir⟩ -U⟨symbol⟩
-i -i⟨dir⟩[:⟨dir⟩]*
-fbreak-on-error -fno-break-on-error -fbreak-on-exception -fno-break-on-exception -fghci-hist-size=⟨n⟩ -fghci-leak-check -fno-ghci-leak-check -flocal-ghci-history -fno-local-ghci-history -fno-it -fno-no-it -fprint-bind-result -fno-print-bind-result -fprint-evld-with-show -fshow-loaded-modules -ghci-script -ignore-dot-ghci -no-ignore-dot-ghci -interactive-print ⟨name⟩
--show-iface ⟨file⟩ -ddump-hi -ddump-hi-diffs -ddump-minimal-imports
-keep-hc-file -keep-hc-files -keep-hi-files -no-keep-hi-files -keep-hscpp-file -keep-hscpp-files -keep-llvm-file -keep-llvm-files -keep-o-files -no-keep-o-files -keep-s-file -keep-s-files -keep-tmp-files
-XAllowAmbiguousTypes -XApplicativeDo -XArrows -XBangPatterns -XBinaryLiterals -XBlockArguments -XCApiFFI -XConstrainedClassMethods -XConstraintKinds -XCPP -XCUSKs -XDataKinds -XDatatypeContexts -XDeepSubsumption -XDefaultSignatures -XDeriveAnyClass -XDeriveDataTypeable -XDeriveFoldable -XDeriveFunctor -XDeriveGeneric -XDeriveLift -XDeriveTraversable -XDerivingStrategies -XDerivingVia -XDisambiguateRecordFields -XDuplicateRecordFields -XEmptyCase -XEmptyDataDecls -XEmptyDataDeriving -XExistentialQuantification -XExplicitForAll -XExplicitNamespaces -XExtendedDefaultRules -XFieldSelectors -XFlexibleContexts -XFlexibleInstances -XForeignFunctionInterface -XFunctionalDependencies -XGADTs -XGADTSyntax -XGeneralisedNewtypeDeriving -XGeneralizedNewtypeDeriving -XGHC2021 -XGHCForeignImportPrim -XHaskell2010 -XHaskell98 -XHexFloatLiterals -XImplicitParams -XImportQualifiedPost -XImpredicativeTypes -XIncoherentInstances -XInstanceSigs -XInterruptibleFFI -XKindSignatures -XLambdaCase -XLexicalNegation -XLiberalTypeSynonyms -XLinearTypes -XMagicHash -XMonadComprehensions -XMonoLocalBinds -XMultiParamTypeClasses -XMultiWayIf -XNamedFieldPuns -XNamedWildCards -XNegativeLiterals -XNoImplicitPrelude -XNoMonomorphismRestriction -XNondecreasingIndentation -XNoPatternGuards -XNoTraditionalRecordSyntax -XNPlusKPatterns -XNullaryTypeClasses -XNumDecimals -XNumericUnderscores -XOverlappingInstances -XOverloadedLabels -XOverloadedLists -XOverloadedRecordDot -XOverloadedRecordUpdate -XOverloadedStrings -XPackageImports -XParallelListComp -XPartialTypeSignatures -XPatternSynonyms -XPolyKinds -XPostfixOperators -XQualifiedDo -XQuantifiedConstraints -XQuasiQuotes -XRank2Types -XRankNTypes -XRebindableSyntax -XRecordWildCards -XRecursiveDo -XRoleAnnotations -XSafe -XScopedTypeVariables -XStandaloneDeriving -XStandaloneKindSignatures -XStarIsType -XStaticPointers -XStrict -XStrictData -XTemplateHaskell -XTemplateHaskellQuotes -XTransformListComp -XTrustworthy -XTupleSections -XTypeApplications -XTypeFamilies -XTypeFamilyDependencies -XTypeInType -XTypeOperators -XTypeSynonymInstances -XUnboxedSums -XUnboxedTuples -XUndecidableInstances -XUndecidableSuperClasses -XUnicodeSyntax -XUnliftedDatatypes -XUnliftedFFITypes -XUnliftedNewtypes -XUnsafe -XViewPatterns
-c -debug -dylib-install-name ⟨path⟩ -dynamic -dynload -eventlog -fcompact-unwind -fkeep-cafs -flink-rts -fno-embed-manifest -fno-gen-manifest -fno-shared-implib -framework ⟨name⟩ -framework-path ⟨dir⟩ -fuse-rpaths -fwhole-archive-hs-libs -L ⟨dir⟩ -l ⟨lib⟩ -main-is ⟨thing⟩ -no-hs-main -no-pie -pie -no-rtsopts-suggestions -package ⟨name⟩ -pie -no-pie -rdynamic -rtsopts[=⟨none|some|all|ignore|ignoreAll⟩] -shared -split-sections -static -staticlib -threaded -with-rtsopts=⟨opts⟩
-fexternal-interpreter -ffamily-application-cache -fno-family-application-cache -fglasgow-exts -fno-glasgow-exts -fno-safe-haskell -ghcversion-file ⟨path to ghcversion.h⟩ -H ⟨size⟩ -j[⟨n⟩]
--frontend ⟨module⟩ --help -? --info --interactive --make --mk-dll --numeric-version --print-booter-version --print-build-platform --print-c-compiler-flags --print-c-compiler-link-flags --print-debug-on --print-global-package-db --print-have-interpreter --print-have-native-code-generator --print-host-platform --print-ld-flags --print-leading-underscore --print-libdir --print-object-splitting-supported --print-project-git-commit-id --print-project-version --print-rts-ways --print-stage --print-support-smp --print-tables-next-to-code --print-target-platform --print-unregisterised --run ⟨file⟩ --show-iface ⟨file⟩ --show-options --supported-extensions --supported-languages --version -V -e ⟨expr⟩ -M
-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-elim-common-blocks -fno-cmm-elim-common-blocks -fcmm-sink -fno-cmm-sink -fcmm-static-pred -fno-cmm-static-pred -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 -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 -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 -fregs-graph -fno-regs-graph -fregs-iterative -fno-regs-iterative -fsimpl-tick-factor=⟨n⟩ -fsimplifier-phases=⟨n⟩ -fsolve-constant-dicts -fno-solve-constant-dicts -fspec-constr -fno-spec-constr -fspec-constr-count=⟨n⟩ -fno-spec-constr-count -fspec-constr-keen -fno-spec-constr-keen -fspec-constr-threshold=⟨n⟩ -fno-spec-constr-threshold -fspecialise -fno-specialise -fspecialise-aggressively -fno-specialise-aggressively -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
-O -O1 -O0 -O0 -O2 -O0 -O⟨n⟩ -O0
-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
-C -c -E -F -S -x ⟨suffix⟩
-pgma ⟨cmd⟩ -pgmc ⟨cmd⟩ -pgmdll ⟨cmd⟩ -pgmF ⟨cmd⟩ -pgmi ⟨cmd⟩ -pgminstall_name_tool ⟨cmd⟩ -pgmL ⟨cmd⟩ -pgml ⟨cmd⟩ -pgmlc ⟨cmd⟩ -pgmlibtool ⟨cmd⟩ -pgmlm ⟨cmd⟩ -pgmlo ⟨cmd⟩ -pgmotool ⟨cmd⟩ -pgmP ⟨cmd⟩ -pgms ⟨cmd⟩ -pgmwindres ⟨cmd⟩
-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
-mavx -mavx2 -mavx512cd -mavx512er -mavx512f -mavx512pf -mbmi -mbmi2 -msse -msse2 -msse3 -msse4 -msse4.2
-fclear-plugins -fplugin-opt=⟨module⟩:⟨args⟩ -fplugin-trustworthy -fplugin=⟨module⟩ -hide-all-plugin-packages -plugin-package ⟨pkg⟩ -plugin-package-id ⟨pkg-id⟩
-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⟩ -no-auto -no-auto-all -no-caf-all -prof -ticky -ticky-allocd -ticky-dyn-thunk
-fhpc
-fforce-recomp -fno-force-recomp -fignore-hpc-changes -fno-ignore-hpc-changes -fignore-optim-changes -fno-ignore-optim-changes
--exclude-module=⟨file⟩ -ddump-mod-cycles -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⟩ -include-cpp-deps -include-pkg-deps -o ⟨file⟩ -odir ⟨dir⟩ -ohi ⟨file⟩ -osuf ⟨suffix⟩ -outputdir ⟨dir⟩ -stubdir ⟨dir⟩
-tmpdir ⟨dir⟩
-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-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-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⟩
-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 -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 -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-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 -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 -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
Code generation¶
-dynamic-tooBuild dynamic object files as well as static object files during compilation
-fasmUse the native code generator
-fbyte-codeGenerate byte-code
-fexpose-internal-symbolsProduce symbols for all functions, including internal functions.
-fexternal-dynamic-refsGenerate code for linking against dynamic libraries
-fllvmCompile using the LLVM code generator
-fno-codeOmit code generation
-fobject-codeGenerate object code
-fPICGenerate position-independent code (where available)
-fPIEGenerate code for a position-independent executable (where available)
-fwrite-interfaceAlways write interface files
-split-objsSplit generated object files into smaller files
Debugging the compiler¶
-dasm-lintASM pass sanity checking
-dcmm-lintC-\- pass sanity checking
-dcore-lintTurn on internal sanity checking
-ddump-asmDump final assembly
-ddump-asm-expandedDump the result of the synthetic instruction expansion pass.
-ddump-asm-livenessDump assembly augmented with register liveness
-ddump-asm-nativeDump initial assembly
-ddump-asm-regallocDump the result of register allocation
-ddump-asm-regalloc-stagesDump the build/spill stages of the
-fregs-graphregister allocator.-ddump-asm-statsDump statistics from the register allocator.
-ddump-bcosDump interpreter byte code
-ddump-c-backendDump C code produced by the C (unregisterised) backend.
-ddump-cfg-weightsDump the assumed weights of the CFG.
-ddump-cmmDump the final C-\- output
-ddump-cmm-cafDump the results of the C-\- CAF analysis pass.
-ddump-cmm-cbeDump the results of common block elimination
-ddump-cmm-cfgDump the results of the C-\- control flow optimisation pass.
-ddump-cmm-cpsDump the results of the CPS pass
-ddump-cmm-from-stgDump STG-to-C-\- output
-ddump-cmm-infoDump the results of the C-\- info table augmentation pass.
-ddump-cmm-optDump the results of C-\- to C-\- optimising passes
-ddump-cmm-procDump the results of proc-point analysis
-ddump-cmm-procmapDump the results of the C-\- proc-point map pass.
-ddump-cmm-rawDump raw C-\-
-ddump-cmm-sinkDump the results of the C-\- sinking pass.
-ddump-cmm-spDump the results of the C-\- stack layout pass.
-ddump-cmm-splitDump the results of the C-\- proc-point splitting pass.
-ddump-cmm-switchDump the results of switch lowering passes
-ddump-cmm-verboseWrite output from main C-\- pipeline passes to files
-ddump-cmm-verbose-by-procShow output from main C-\- pipeline passes (grouped by proc)
-ddump-core-statsPrint a one-line summary of the size of the Core program at the end of the optimisation pipeline
-ddump-cpr-signaturesDump CPR signatures
-ddump-cpranalDump CPR analysis output
-ddump-cseDump CSE output
-ddump-derivDump deriving output
-ddump-dsDump desugarer output.
-ddump-ec-traceTrace exhaustiveness checker
-ddump-faststringsDump the whole FastString table when finished
-ddump-file-prefix=⟨str⟩Set the prefix of the filenames used for debugging output.
-ddump-foreignDump
foreign exportstubs-ddump-hieDump the hie file syntax tree
-ddump-hpcAn alias for
-ddump-ticked.-ddump-if-traceTrace interface files
-ddump-inliningsDump inlining info
-ddump-jsonDump error messages as JSON documents
-ddump-llvmDump LLVM intermediate code.
-ddump-mod-mapDump the state of the module mapping database.
-ddump-occur-analDump occurrence analysis output
-ddump-opt-cmmDump the results of C-\- to C-\- optimising passes
-ddump-parsedDump parse tree
-ddump-parsed-astDump parser output as a syntax tree
-ddump-prepDump prepared core
-ddump-rnDump renamer output
-ddump-rn-astDump renamer output as a syntax tree
-ddump-rn-statsRenamer stats
-ddump-rn-traceTrace renamer
-ddump-rttiTrace runtime type inference
-ddump-rule-firingsDump rule firing info
-ddump-rule-rewritesDump detailed rule firing info
-ddump-rulesDump rewrite rules
-ddump-simplDump final simplifier output
-ddump-simpl-iterationsDump output from each simplifier iteration
-ddump-simpl-statsDump simplifier stats
-ddump-specDump specialiser output
-ddump-splicesDump TH spliced expressions, and what they evaluate to
-ddump-stg(deprecated) Alias for
-ddump-stg-from-core-ddump-stg-finalShow output of last STG pass.
-ddump-stg-from-coreShow CoreToStg output
-ddump-stg-unarisedShow unarised STG
-ddump-str-signaturesDump top-level demand signatures
-ddump-stranalDump demand analysis output
-ddump-tcDump typechecker output
-ddump-tc-astDump typechecker output as a syntax tree
-ddump-tc-traceTrace typechecker
-ddump-tickedDump the code instrumented by HPC (Observing Code Coverage).
-ddump-timingsDump per-pass timing and allocation statistics
-ddump-to-fileDump to files instead of stdout
-ddump-typesDump type signatures
-ddump-worker-wrapperDump worker-wrapper output
-dfaststring-statsShow statistics for fast string usage when finished
-dhex-word-literalsPrint values of type Word# in hexadecimal.
-dinitial-unique=⟨s⟩Start
UniqSupplyallocation from ⟨s⟩.-dinline-check=⟨str⟩Dump information about inlining decisions
-dlinear-core-lintTurn on internal sanity checking
-dno-debug-outputSuppress unsolicited debugging output
-dno-typeable-bindsDon't generate bindings for Typeable methods
-dppr-case-as-letPrint single alternative case expressions as strict lets.
-dppr-cols=⟨n⟩Set the width of debugging output. For example
-dppr-cols200-dppr-debugTurn on debug printing (more verbose)
-dppr-user-lengthSet the depth for printing expressions in error msgs
-drule-check=⟨str⟩Dump information about potential rule application
-dshow-passesPrint out each pass name as it happens
-dstg-lintSTG pass sanity checking
-dsuppress-allIn dumps, suppress everything (except for uniques) that is suppressible.
-dsuppress-coercionsSuppress the printing of coercions in Core dumps to make them shorter
-dsuppress-idinfoSuppress extended information about identifiers where they are bound
-dsuppress-module-prefixesSuppress the printing of module qualification prefixes
-dsuppress-stg-free-varsSuppress the printing of closure free variable lists in STG output
-dsuppress-ticksSuppress "ticks" in the pretty-printer output.
-dsuppress-timestampsSuppress timestamps in dumps
-dsuppress-type-applicationsSuppress type applications
-dsuppress-type-signaturesSuppress type signatures
-dsuppress-unfoldingsSuppress the printing of the stable unfolding of a variable at its binding site
-dsuppress-uniquesSuppress the printing of uniques in debug output (easier to use
diff)-dsuppress-var-kindsSuppress the printing of variable kinds
-dth-dec-fileDump evaluated TH declarations into *.th.hs files
-dunique-increment=⟨i⟩Set the increment for the generated
Unique's to ⟨i⟩.-dverbose-core2coreShow output from each core-to-core pass
-dverbose-stg2stgShow output from each STG-to-STG pass
-falignment-sanitisationCompile with alignment checks for all info table dereferences.
-fcatch-bottomsAdd a default
erroralternative to case expressions without a default alternative.-fcheck-prim-boundsInstrument array primops with bounds checks.
-fdistinct-constructor-tablesGenerate a fresh info table for each usage of a data constructor.
-finfo-table-mapEmbed a lookup table in the generated binary which maps the address of an info table to the source position the closure originated from.
-fllvm-fill-undef-with-garbageIntruct LLVM to fill dead STG registers with garbage
-fproc-alignmentAlign functions at given boundary.
-gProduce DWARF debug information in compiled object files. ⟨n⟩ can be 0, 1, or 2, with higher numbers producing richer output. If ⟨n⟩ is omitted, level 2 is assumed.
C pre-processor¶
-cppRun the C pre-processor on Haskell source files
-D⟨symbol⟩[=⟨value⟩]Define a symbol in the C pre-processor
-I⟨dir⟩Add ⟨dir⟩ to the directory search list for
#includefiles-U⟨symbol⟩Undefine a symbol in the C pre-processor
Finding imports¶
-iEmpty the import directory list
-i⟨dir⟩[:⟨dir⟩]*add ⟨dir⟩, ⟨dir2⟩, etc. to import path
Interactive mode¶
-fbreak-on-error-fbreak-on-exception-fghci-hist-size=⟨n⟩Set the number of entries GHCi keeps for
:history. See The GHCi Debugger.-fghci-leak-check(Debugging only) check for space leaks when loading new modules in GHCi.
-flocal-ghci-historyUse current directory for the GHCi command history file
.ghci-history.-fno-itNo longer set the special variable
it.-fprint-bind-result-fprint-evld-with-showInstruct
:printto useShowinstances where possible.-fshow-loaded-modulesShow the names of modules that GHCi loaded after a
:loadcommand.-ghci-scriptRead additional
.ghcifiles-ignore-dot-ghciDisable reading of
.ghcifiles-interactive-print ⟨name⟩Select the function to use for printing evaluated expressions in GHCi
Interface files¶
--show-iface ⟨file⟩See Modes of operation.
-ddump-hiDump the new interface to stdout
-ddump-hi-diffsShow the differences vs. the old interface
-ddump-minimal-importsDump a minimal set of imports
Keeping intermediate files¶
-keep-hc-fileRetain intermediate
.hcfiles.-keep-hi-filesRetain intermediate
.hifiles (the default).-keep-hscpp-fileRetain intermediate
.hscppfiles.-keep-llvm-fileRetain intermediate LLVM
.llfiles. Implies-fllvm.-keep-o-filesRetain intermediate
.ofiles (the default).-keep-s-fileRetain intermediate
.sfiles.-keep-tmp-filesRetain all intermediate temporary files.
Language options¶
-XAllowAmbiguousTypesAllow the user to write ambiguous types, and the type inference engine to infer them.
-XApplicativeDoEnable Applicative do-notation desugaring
-XArrowsEnable arrow notation extension
-XBangPatternsEnable bang patterns.
-XBinaryLiteralsEnable support for binary literals.
-XBlockArgumentsAllow
doblocks and other constructs as function arguments.-XCApiFFIEnable the CAPI calling convention.
-XConstrainedClassMethodsEnable constrained class methods.
-XConstraintKindsEnable a kind of constraints.
-XCPPEnable the C preprocessor.
-XCUSKsEnable detection of complete user-supplied kind signatures.
-XDataKindsEnable datatype promotion.
-XDatatypeContextsAllow contexts on
datatypes.-XDeepSubsumptionEnable deep subsumption
-XDefaultSignaturesEnable default signatures.
-XDeriveAnyClassEnable deriving for any class.
-XDeriveDataTypeableEnable deriving for the
Dataclass. Implied by (deprecated)AutoDeriveTypeable.-XDeriveFoldableEnable deriving for the Foldable class. Implied by
DeriveTraversable.-XDeriveFunctorEnable deriving for the Functor class. Implied by
DeriveTraversable.-XDeriveGenericEnable deriving for the Generic class.
-XDeriveLiftEnable deriving for the Lift class
-XDeriveTraversableEnable deriving for the Traversable class. Implies
DeriveFunctorandDeriveFoldable.-XDerivingStrategiesEnables deriving strategies.
-XDerivingViaEnable deriving instances
viatypes of the same runtime representation. ImpliesDerivingStrategies.-XDisambiguateRecordFieldsEnable record field disambiguation. Implied by
RecordWildCards.-XDuplicateRecordFieldsAllow definition of record types with identically-named fields.
-XEmptyCaseAllow empty case alternatives.
-XEmptyDataDeclsAllow definition of empty
datatypes.-XEmptyDataDerivingAllow deriving instances of standard type classes for empty data types.
-XExistentialQuantificationEnable liberalised type synonyms.
-XExplicitForAllEnable explicit universal quantification. Implied by
ScopedTypeVariables,LiberalTypeSynonyms,RankNTypesandExistentialQuantification.-XExplicitNamespacesEnable using the keyword
typeto specify the namespace of entries in imports and exports (Explicit namespaces in import/export). Implied byTypeOperatorsandTypeFamilies.-XExtendedDefaultRulesUse GHCi's extended default rules in a normal module.
-XFieldSelectorsControl visibility of field selector functions.
-XFlexibleContextsRemove some restrictions on class contexts
-XFlexibleInstancesEnable flexible instances. Implies
TypeSynonymInstances.-XForeignFunctionInterfaceEnable foreign function interface.
-XFunctionalDependenciesEnable functional dependencies. Implies
MultiParamTypeClasses.-XGADTsEnable generalised algebraic data types. Implies
GADTSyntaxandMonoLocalBinds.-XGADTSyntaxEnable generalised algebraic data type syntax.
-XGeneralisedNewtypeDerivingEnable newtype deriving.
-XGeneralizedNewtypeDerivingEnable newtype deriving.
-XGHC2021Use GHC’s set of default language extensions from 2021
-XGHCForeignImportPrimEnable prim calling convention. Intended for internal use only.
-XHaskell2010Use the Haskell 2010 language variant.
-XHaskell98Use the Haskell 98 language variant.
-XHexFloatLiteralsEnable support for hexadecimal floating point literals.
-XImplicitParamsEnable Implicit Parameters.
-XImportQualifiedPostImportQualifiedPostallows the syntaximport M qualified-XImpredicativeTypesEnable impredicative types. Implies
RankNTypes.-XIncoherentInstancesEnable incoherent instances. Implies
OverlappingInstances.-XInstanceSigsEnable instance signatures.
-XInterruptibleFFIEnable interruptible FFI.
-XKindSignaturesEnable kind signatures. Implied by
TypeFamiliesandPolyKinds.-XLambdaCaseEnable lambda-case expressions.
-XLexicalNegationUse whitespace to determine whether the minus sign stands for negation or subtraction.
-XLiberalTypeSynonymsEnable liberalised type synonyms.
-XLinearTypesEnable linear types.
-XMagicHashAllow
#as a postfix modifier on identifiers.-XMonadComprehensionsEnable monad comprehensions.
-XMonoLocalBindsEnable do not generalise local bindings. Implied by
TypeFamiliesandGADTs.-XMultiParamTypeClassesEnable multi parameter type classes. Implied by
FunctionalDependencies.-XMultiWayIfEnable multi-way if-expressions.
-XNamedFieldPunsEnable record puns.
-XNamedWildCardsEnable named wildcards.
-XNegativeLiteralsEnable support for negative literals.
-XNoImplicitPreludeDon't implicitly
import Prelude. Implied byRebindableSyntax.-XNoMonomorphismRestrictionDisable the monomorphism restriction.
-XNondecreasingIndentationAllow nested contexts to be at the same indentation level as its enclosing context.
-XNoPatternGuardsDisable pattern guards. Implied by
Haskell98.-XNoTraditionalRecordSyntaxDisable support for traditional record syntax (as supported by Haskell 98)
C {f = x}-XNPlusKPatternsEnable support for
n+kpatterns. Implied byHaskell98.-XNullaryTypeClassesDeprecated, does nothing. nullary (no parameter) type classes are now enabled using
MultiParamTypeClasses.-XNumDecimalsEnable support for 'fractional' integer literals.
-XNumericUnderscoresEnable support for numeric underscores.
-XOverlappingInstancesEnable overlapping instances.
-XOverloadedLabelsEnable overloaded labels.
-XOverloadedListsEnable overloaded lists.
-XOverloadedRecordDotRecord '.' syntax
-XOverloadedRecordUpdateRecord '.' syntax record updates
-XOverloadedStringsEnable overloaded string literals.
-XPackageImportsEnable package-qualified imports.
-XParallelListCompEnable parallel list comprehensions.
-XPartialTypeSignaturesEnable partial type signatures.
-XPatternSynonymsEnable pattern synonyms.
-XPolyKindsEnable kind polymorphism. Implies
KindSignatures.-XPostfixOperatorsEnable postfix operators.
-XQualifiedDoEnable qualified do-notation desugaring.
-XQuantifiedConstraintsAllow
forallquantifiers in constraints.-XQuasiQuotesEnable quasiquotation.
-XRank2TypesEnable rank-2 types. Synonym for
RankNTypes.-XRankNTypesEnable rank-N types. Implied by
ImpredicativeTypes.-XRebindableSyntaxEmploy rebindable syntax. Implies
NoImplicitPrelude.-XRecordWildCardsEnable record wildcards. Implies
DisambiguateRecordFields.-XRecursiveDoEnable recursive do (mdo) notation.
-XRoleAnnotationsEnable role annotations.
-XSafeEnable the Safe Haskell Safe mode.
-XScopedTypeVariablesEnable lexically-scoped type variables.
-XStandaloneDerivingEnable standalone deriving.
-XStandaloneKindSignaturesAllow the use of standalone kind signatures.
-XStarIsTypeTreat
*asData.Kind.Type.-XStaticPointersEnable static pointers.
-XStrictMake bindings in the current module strict by default.
-XStrictDataEnable default strict datatype fields.
-XTemplateHaskellEnable Template Haskell.
-XTemplateHaskellQuotesEnable quotation subset of Template Haskell.
-XTransformListCompEnable generalised list comprehensions.
-XTrustworthyEnable the Safe Haskell Trustworthy mode.
-XTupleSectionsEnable tuple sections.
-XTypeApplicationsEnable type application syntax in terms, patterns and types.
-XTypeFamiliesEnable type families. Implies
ExplicitNamespaces,KindSignatures, andMonoLocalBinds.-XTypeFamilyDependenciesEnable injective type families. Implies
TypeFamilies.-XTypeInTypeDeprecated. Enable kind polymorphism and datatype promotion.
-XTypeOperatorsEnable type operators. Implies
ExplicitNamespaces.-XTypeSynonymInstancesEnable type synonyms in instance heads. Implied by
FlexibleInstances.-XUnboxedSumsEnable unboxed sums.
-XUnboxedTuplesEnable the use of unboxed tuple syntax.
-XUndecidableInstancesEnable undecidable instances.
-XUndecidableSuperClassesAllow all superclass constraints, including those that may result in non-termination of the typechecker.
-XUnicodeSyntaxEnable unicode syntax.
-XUnliftedDatatypesEnable unlifted data types.
-XUnliftedFFITypesEnable unlifted FFI types
-XUnliftedNewtypesEnable unlifted newtypes.
-XUnsafeEnable Safe Haskell Unsafe mode.
-XViewPatternsEnable view patterns.
Linking options¶
-cStop after generating object (
.o) file-debugUse the debugging runtime
-dylib-install-name ⟨path⟩Set 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)-dynamicBuild dynamically-linked object files and executables
-dynloadSelects one of a number of modes for finding shared libraries at runtime.
-eventlogEnable runtime event tracing
-fcompact-unwindInstruct the linker to produce a __compact_unwind section.
-fkeep-cafsDo not garbage-collect CAFs (top-level expressions) at runtime
-flink-rtsLink the runtime when generating a shared or static library
-fno-embed-manifestDo not embed the manifest in the executable (Windows only)
-fno-gen-manifestDo not generate a manifest file (Windows only)
-fno-shared-implibDon'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.-fuse-rpathsSet the rpath based on -L flags
-fwhole-archive-hs-libsWhen linking a binary executable, this inserts the flag
-Wl,--whole-archivebefore any-lflags for Haskell libraries, and-Wl,--no-whole-archiveafterwards-L ⟨dir⟩Add ⟨dir⟩ to the list of directories searched for libraries
-l ⟨lib⟩Link in library ⟨lib⟩
-main-is ⟨thing⟩Set main module and function
-no-hs-mainDon't assume this program contains
main-no-pieDon't instruct the linker to produce a position-independent executable.
-no-rtsopts-suggestionsDon't print RTS suggestions about linking with
-rtsopts[=⟨none|some|all|ignore|ignoreAll⟩].-package ⟨name⟩Expose package ⟨pkg⟩
-pieInstruct the linker to produce a position-independent executable.
-rdynamicThis instructs the linker to add all symbols, not only 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⟩]Control whether the RTS behaviour can be tweaked via command-line flags and the
GHCRTSenvironment 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.-rtsoptsdoes not affect-with-rtsoptsbehavior; flags passed via-with-rtsoptsare used regardless of-rtsopts.-sharedGenerate a shared library (as opposed to an executable)
-split-sectionsSplit sections for link-time dead-code stripping
-staticUse static Haskell libraries
-staticlibGenerate 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 in a single static library that can be linked against.
-threadedUse the threaded runtime
-with-rtsopts=⟨opts⟩Set the default RTS options to ⟨opts⟩.
Miscellaneous options¶
-fexternal-interpreterRun interpreted code in a separate process
-ffamily-application-cacheUse a cache when reducing type family applications
-fglasgow-extsDeprecated. Enable most language extensions; see Controlling extensions for exactly which ones.
-fno-safe-haskellDisable Safe Haskell
-ghcversion-file ⟨path to ghcversion.h⟩(GHC as a C compiler only) Use this
ghcversion.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; see Frontend plugins for details.
--helpDisplay help
--infodisplay information about the compiler
--interactiveInteractive mode - normally used by just running
ghci; see Using GHCi for details.--makeBuild a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than using
make; see Using ghc --make for details.--mk-dllDLL-creation mode (Windows only)
--numeric-versiondisplay GHC version (numeric only)
--print-booter-versiondisplay bootstrap compiler version
--print-build-platformdisplay platform on which GHC was built
--print-c-compiler-flagsC compiler flags used to build GHC
--print-c-compiler-link-flagsC linker flags used to build GHC
--print-debug-onprint whether GHC was built with
-DDEBUG--print-global-package-dbdisplay GHC's global package database directory
--print-have-interpreterdisplay whether GHC was built with interactive support
--print-have-native-code-generatordisplay whether target platform has NCG support
--print-host-platformdisplay host platform of GHC
--print-ld-flagsdisplay linker flags used to compile GHC
--print-leading-underscoredisplay use of leading underscores on symbol names
--print-libdirdisplay GHC library directory
--print-object-splitting-supporteddisplay whether GHC supports object splitting
--print-project-git-commit-iddisplay Git commit id GHC is built from
--print-project-versiondisplay GHC version
--print-rts-waysdisplay which way RTS was built
--print-stagedisplay
stagenumber of GHC--print-support-smpdisplay whether GHC was compiled with SMP support
--print-tables-next-to-codedisplay whether GHC was compiled with
--enable-tables-next-to-code--print-target-platformdisplay target platform of GHC
--print-unregisteriseddisplay 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-optionsdisplay the supported command line options
--supported-extensionsdisplay the supported language extensions
--versiondisplay GHC version
-e ⟨expr⟩Evaluate
expr; see Expression evaluation mode for details.-Mgenerate dependency information suitable for use in a
Makefile; see Dependency generation for details.
Individual optimizations¶
-fasm-shortcuttingEnable shortcutting on assembly. Implied by
-O2.-fbinary-blob-threshold=⟨n⟩default: 500K. Tweak assembly generator for binary blobs.
-fblock-layout-cfgUse the new cfg based block layout algorithm.
-fblock-layout-weightlessIgnore cfg weights for code layout.
-fblock-layout-weightsSets edge weights used by the new code layout algorithm.
-fcall-arityEnable call-arity optimisation. Implied by
-O.-fcase-foldingEnable constant folding in case expressions. Implied by
-O.-fcase-mergeEnable case-merging. Implied by
-O.-fcmm-elim-common-blocksEnable Cmm common block elimination. Implied by
-O.-fcmm-sinkEnable Cmm sinking. Implied by
-O.-fcmm-static-predEnable static control flow prediction. Implied by
-O.-fcpr-analTurn on CPR analysis in the demand analyser. Implied by
-O.-fcross-module-specialiseTurn on specialisation of overloaded functions imported from other modules.
-fcseEnable common sub-expression elimination. Implied by
-O.-fdicts-cheapMake dictionary-valued expressions seem cheap to the optimiser.
-fdicts-strictMake dictionaries strict
-fdmd-tx-dict-sel(deprecated) Use a special demand transformer for dictionary selectors.
-fdo-eta-reductionEnable eta-reduction. Implied by
-O.-fdo-lambda-eta-expansionEnable lambda eta-expansion. Always enabled by default.
-feager-blackholingTurn on eager blackholing
-fenable-rewrite-rulesSwitch on all rewrite rules (including rules generated by automatic specialisation of overloaded functions). Implied by
-O.-fexcess-precisionEnable excess intermediate precision
-fexitificationEnables exitification optimisation. Implied by
-O.-fexpose-all-unfoldingsExpose all unfoldings, even for very large or recursive functions.
-ffloat-inTurn on the float-in transformation. Implied by
-O.-ffull-lazinessTurn on full laziness (floating bindings outwards). Implied by
-O.-ffun-to-thunkAllow worker-wrapper to convert a function closure into a thunk if the function does not use any of its arguments. Off by default.
-fignore-assertsIgnore assertions in the source. Implied by
-O.-fignore-interface-pragmasIgnore pragmas in interface files. Implied by
-O0only.-finline-genericsAnnotate methods of derived Generic and Generic1 instances with INLINE[1] pragmas based on heuristics. Implied by
-O.-finline-generics-aggressivelyAnnotate methods of all derived Generic and Generic1 instances with INLINE[1] pragmas.
-flate-dmd-analRun demand analysis again, at the end of the simplification pipeline
-flate-specialiseRun a late specialisation pass
-fliberate-caseTurn 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(deprecated) Does nothing
-floopificationTurn 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. Inline
memcpycalls if they would generate no more than ⟨n⟩ pseudo instructions.-fmax-inline-memset-insns=⟨n⟩default: 32. Inline
memsetcalls if they would generate no more than ⟨n⟩ pseudo instructions-fmax-simplifier-iterations=⟨n⟩default: 4. Set the max iterations for the simplifier.
-fmax-uncovered-patterns=⟨n⟩default: 4. Set the maximum number of patterns to display in warnings about non-exhaustive ones.
-fmax-worker-args=⟨n⟩default: 10. Maximum number of value arguments for a worker.
-fno-opt-coercionTurn off the coercion optimiser
-fno-pre-inliningTurn off pre-inlining
-fno-state-hackTurn off the state hackwhereby any lambda with a real-world state token as argument is considered to be single-entry. Hence OK to inline things inside it.
-fomit-interface-pragmasDon't generate interface pragmas. Implied by
-O0only.-fomit-yieldsOmit heap checks when no allocation is being performed.
-foptimal-applicative-doUse a slower but better algorithm for ApplicativeDo
-fpedantic-bottomsMake GHC be more precise about its treatment of bottom (but see also
-fno-state-hack). In particular, GHC will not eta-expand through a case expression.-fregs-graphUse the graph colouring register allocator for register allocation in the native code generator.
-fregs-iterativeUse the iterative coalescing graph colouring register allocator in the native code generator.
-fsimpl-tick-factor=⟨n⟩default: 100. Set the percentage factor for simplifier ticks.
-fsimplifier-phases=⟨n⟩default: 2. Set the number of phases for the simplifier. Ignored with
-O0.-fsolve-constant-dictsWhen solving constraints, try to eagerly solve super classes using available dictionaries.
-fspec-constrTurn on the SpecConstr transformation. Implied by
-O2.-fspec-constr-count=⟨n⟩default: 3.* Set to ⟨n⟩ the maximum number of specialisations that will be created for any one function by the SpecConstr transformation.
-fspec-constr-keenSpecialize a call with an explicit constructor argument, even if the argument is not scrutinised in the body of the function
-fspec-constr-threshold=⟨n⟩default: 2000. Set the size threshold for the SpecConstr transformation to ⟨n⟩.
-fspecialiseTurn on specialisation of overloaded functions. Implied by
-O.-fspecialise-aggressivelyTurn on specialisation of overloaded functions regardless of size, if unfolding is available
-fstatic-argument-transformationTurn on the static argument transformation.
-fstg-cseEnable common sub-expression elimination on the STG intermediate language
-fstg-lift-lamsEnable late lambda lifting on the STG intermediate language. Implied by
-O2.-fstg-lift-lams-knownAllow turning known into unknown calls while performing late lambda lifting.
-fstg-lift-lams-non-rec-argsCreate top-level non-recursive functions with at most <n> parameters while performing late lambda lifting.
-fstg-lift-lams-rec-argsCreate top-level recursive functions with at most <n> parameters while performing late lambda lifting.
-fstrictnessTurn on demand analysis. Implied by
-O. Implies-fworker-wrapper-fstrictness-before=⟨n⟩Run an additional demand analysis before simplifier phase ⟨n⟩
-funbox-small-strict-fieldsFlatten strict constructor fields with a pointer-sized representation. Implied by
-O.-funbox-strict-fieldsFlatten 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.
-funfolding-use-threshold=⟨n⟩default: 80. Tweak unfolding settings.
-fworker-wrapperEnable the worker/wrapper transformation.
Optimization levels¶
Package options¶
-clear-package-dbClear the package db stack.
-distrust ⟨pkg⟩Expose package ⟨pkg⟩ and set it to be distrusted. See Safe Haskell.
-distrust-all-packagesDistrust all packages by default. See Safe Haskell.
-fpackage-trustEnable Safe Haskell trusted package requirement for trustworthy modules.
-global-package-dbAdd the global package db to the stack.
-hide-all-packagesHide all packages by default
-hide-package ⟨pkg⟩Hide package ⟨pkg⟩
-ignore-package ⟨pkg⟩Ignore package ⟨pkg⟩
-no-auto-link-packagesDon't automatically link in the base and rts packages.
-no-global-package-dbRemove the global package db from the stack.
-no-user-package-dbRemove 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-dbAdd the user's package db to the stack.
Phases of compilation¶
-CStop after generating C (
.hcfile)-cStop after generating object (
.o) file-EStop after preprocessing (
.hsppfile)-FEnable the use of a pre-processor (set with
-pgmF ⟨cmd⟩)-SStop 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
-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
runpathinto mach-o dylibs on macOS-pgmL ⟨cmd⟩Use ⟨cmd⟩ as the literate pre-processor
-pgml ⟨cmd⟩Use ⟨cmd⟩ as the linker
-pgmlc ⟨cmd⟩Use ⟨cmd⟩ as the LLVM compiler
-pgmlibtool ⟨cmd⟩Use ⟨cmd⟩ as the command for libtool (with
-staticlibonly).-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⟩ to cpp (with
-cpponly)-optwindres ⟨option⟩pass ⟨option⟩ to
windres.-pgmc-supports-no-pieIndicate that the C compiler supports
-no-pie
Platform-specific options¶
-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-pluginsClear the list of active plugins
-fplugin-opt=⟨module⟩:⟨args⟩Give arguments to a plugin module; module must be specified with
-fplugin=⟨module⟩-fplugin-trustworthyTrust the used plugins and no longer mark the compiled module as unsafe
-fplugin=⟨module⟩Load a plugin exported by a given module
-hide-all-plugin-packagesHide all packages for plugins by default
-plugin-package ⟨pkg⟩Expose ⟨pkg⟩ for plugins
-plugin-package-id ⟨pkg-id⟩Expose ⟨pkg-id⟩ for plugins
Profiling¶
-auto(deprecated) Alias for
-fprof-auto-exported-auto-all(deprecated) Alias for
-fprof-auto-caf-all(deprecated) Alias for
-fprof-cafs-fno-prof-count-entriesDo not collect entry counts
-fprof-autoAuto-add
SCC\ s to all bindings not marked INLINE-fprof-auto-callsAuto-add
SCC\ s to all call sites-fprof-auto-exportedAuto-add
SCC\ s to all exported bindings not markedINLINE-fprof-auto-topAuto-add
SCC\ s to all top-level bindings not marked INLINE-fprof-cafsAuto-add
SCC\ s to all CAFs-fprof-callers=⟨name⟩Auto-add
SCC\ s to all call-sites of the named function.-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-profTurn on profiling
-tickyTurn on ticky-ticky profiling
-ticky-allocdTrack the number of times each closure type is allocated.
-ticky-dyn-thunkTrack allocations of dynamic thunks
Program coverage¶
-fhpcTurn on Haskell program coverage instrumentation
Recompilation checking¶
-fforce-recompTurn off recompilation checking. This is implied by any
-ddump-Xoption when compiling a single file (i.e. when using-c).-fignore-hpc-changesDo not recompile modules just to match changes to HPC flags. This is especially useful for avoiding recompilation when using GHCi, and is enabled by default for GHCi.
-fignore-optim-changesDo not recompile modules just to match changes to optimisation flags. This is especially useful for avoiding recompilation when using GHCi, and is 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-cyclesDump 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
-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
-include-cpp-depsInclude preprocessor dependencies
-include-pkg-depsRegard modules imported from packages as unstable
-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¶
-fabstract-refinement-hole-fitsdefault: off. Toggles whether refinements where one or more of the holes are abstract are reported.
-fdefer-diagnosticsDefer and group diagnostic messages by severity
-fdiagnostics-color=⟨always|auto|never⟩Use colors in error messages
-fdiagnostics-show-caretWhether to show snippets of original source code
-ferror-spansOutput full span in error messages
-fhide-source-pathshide module source and object paths
-fkeep-goingContinue compilation as far as possible on errors
-fmax-refinement-hole-fits=⟨n⟩default: 6. Set the maximum number of refinement hole fits for typed holes to display in type error messages.
-fmax-relevant-binds=⟨n⟩default: 6. Set the maximum number of bindings to display in type error messages.
-fmax-valid-hole-fits=⟨n⟩default: 6. Set the maximum number of valid hole fits for typed holes to display in type error messages.
-fno-show-valid-hole-fitsDisables showing a list of valid hole fits for typed holes in type error messages.
-fno-sort-valid-hole-fitsDisables the sorting of the list of valid hole fits for typed holes in type error messages.
-fprint-axiom-incompsDisplay equation incompatibilities in closed type families
-fprint-equality-relationsDistinguish between equality relations when printing
-fprint-expanded-synonymsIn type errors, also print type-synonym-expanded types.
-fprint-explicit-coercionsPrint coercions in types
-fprint-explicit-forallsPrint explicit
forallquantification in types. See alsoExplicitForAll-fprint-explicit-kindsPrint explicit kind foralls and kind arguments in types. See also
KindSignatures-fprint-explicit-runtime-repsPrint
RuntimeRepvariables in types which are runtime-representation polymorphic.-fprint-potential-instancesdisplay all available instances in type error messages
-fprint-typechecker-elaborationPrint extra information from typechecker.
-fprint-unicode-syntaxUse unicode syntax when printing expressions, types and kinds. See also
UnicodeSyntax-frefinement-level-hole-fits=⟨n⟩default: off. Sets the level of refinement of the refinement hole fits, where level
nmeans that hole fits of up tonholes will be considered.-freverse-errorsOutput errors in reverse order
-fshow-docs-of-hole-fitsToggles whether to show the documentation of the valid hole fits in the output.
-fshow-hole-constraintsShow constraints when reporting typed holes.
-fshow-hole-matches-of-hole-fitsToggles whether to show the type of the additional holes in refinement hole fits.
-fshow-provenance-of-hole-fitsToggles whether to show the provenance of the valid hole fits in the output.
-fshow-type-app-of-hole-fitsToggles whether to show the type application of the valid hole fits in the output.
-fshow-type-app-vars-of-hole-fitsToggles whether to show what type each quantified variable takes in a valid hole fit.
-fshow-type-of-hole-fitsToggles whether to show the type of the valid hole fits in the output.
-fsort-by-size-hole-fitsSort valid hole fits by size.
-fsort-by-subsumption-hole-fitsSort valid hole fits by subsumption.
-funclutter-valid-hole-fitsUnclutter the list of valid hole fits by not showing provenance nor type applications of suggestions.
-Rghc-timingSummarise timing stats for GHC (same as
+RTS -tstderr).-vverbose mode (equivalent to
-v3)-v⟨n⟩set verbosity level
Warnings¶
-fdefer-out-of-scope-variablesConvert variable out of scope variables errors into warnings. Implied by
-fdefer-type-errors. See also-Wdeferred-out-of-scope-variables.-fdefer-type-errorsTurn 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-holesConvert typed hole errors into warnings, deferring the error until runtime. Implied by
-fdefer-type-errors. See also-Wtyped-holes.-fenable-th-splice-warningsGenerate warnings for Template Haskell splices
-fhelpful-errorsMake suggestions for mis-spelled names.
-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-groupsshow which group an emitted warning belongs to.
-fvia-Cuse the C code generator
-Wenable normal warnings
-wdisable all warnings
-Wallenable almost all warnings (details in Warnings and sanity-checking)
-Wall-missed-specialisationswarn when specialisation of any overloaded function fails.
-Wall-missed-specializationsalias for
-Wall-missed-specialisations-Wambiguous-fieldswarn about ambiguous field selectors or updates
-Wauto-orphans(deprecated) Does nothing
-Wcompatenable future compatibility warnings (details in Warnings and sanity-checking)
-Wcompat-unqualified-importsReport unqualified imports of core libraries which are expected to cause compatibility problems in future releases.
-Wcpp-undefwarn on uses of the #if directive on undefined identifiers
-Wdefaultenable default flags
-Wdeferred-out-of-scope-variablesReport warnings when variable out-of-scope errors are deferred until runtime. See
-fdefer-out-of-scope-variables.-Wdeferred-type-errorsReport warnings when deferred type errors are enabled. This option is enabled by default. See
-fdefer-type-errors.-Wdeprecated-flagswarn about uses of commandline flags that are deprecated
-Wdeprecationswarn about uses of functions & types that have warnings or deprecated pragmas. Alias for
-Wwarnings-deprecations-Wderiving-defaultswarn about default deriving when using both
DeriveAnyClassandGeneralizedNewtypeDeriving-Wderiving-typeablewarn when Typeable is derived
-Wdodgy-exportswarn about dodgy exports
-Wdodgy-foreign-importswarn about dodgy foreign imports
-Wdodgy-importswarn about dodgy imports
-Wduplicate-constraintswarn when a constraint appears duplicated in a type signature
-Wduplicate-exportswarn when an entity is exported multiple times
-Wempty-enumerationswarn about enumerations that are empty
-Werrormake warnings fatal
-Weverythingenable all warnings supported by GHC
-Wextraalias for
-W-Whi-shadowing(deprecated) warn when a
.hifile in the current directory shadows a library-Widentitieswarn about uses of Prelude numeric conversions that are probably the identity (and hence could be omitted)
-Wimplicit-kind-varswarn when kind variables are implicitly quantified over.
-Wimplicit-liftwarn about implicit
liftin Template Haskell quotes-Wimplicit-preludewarn when the Prelude is implicitly imported
-Winaccessible-codewarn about inaccessible code
-Wincomplete-patternswarn when a pattern match could fail
-Wincomplete-record-updateswarn when a record update could fail
-Wincomplete-uni-patternswarn when a pattern match in a lambda expression, pattern binding or a lazy pattern could fail
-Winferred-safe-importswarn when an explicitly Safe Haskell module imports a Safe-Inferred one
-Winline-rule-shadowingWarn if a rewrite RULE might fail to fire because the function might be inlined before the rule has a chance to fire. See How rules interact with INLINE/NOINLINE pragmas.
-Winvalid-haddockwarn when a Haddock comment occurs in an invalid position
-Wmissed-extra-shared-libWarn when GHCi can't load a shared lib.
-Wmissed-specialisationswarn when specialisation of an imported, overloaded function fails.
-Wmissed-specializationsalias for
-Wmissed-specialisations-Wmissing-deriving-strategieswarn when a deriving clause is missing a deriving strategy
-Wmissing-export-listswarn when a module declaration does not explicitly list all exports
-Wmissing-exported-signatureswarn about top-level functions without signatures, only if they are exported
-Wmissing-exported-sigs(deprecated) warn about top-level functions without signatures, only if they are exported. takes precedence over -Wmissing-signatures
-Wmissing-fieldswarn when fields of a record are uninitialised
-Wmissing-home-moduleswarn 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 in
exposed-modules, nor inother-modules.-Wmissing-import-listswarn when an import declaration does not explicitly list all the names brought into scope
-Wmissing-kind-signatureswarn when type declarations don't have kind signatures nor CUSKs
-Wmissing-local-signatureswarn about polymorphic local bindings without signatures
-Wmissing-local-sigs(deprecated) warn about polymorphic local bindings without signatures
-Wmissing-methodswarn when class methods are undefined
-Wmissing-monadfail-instancesWarn when a failable pattern is used in a do-block that does not have a
MonadFailinstance.-Wmissing-pattern-synonym-signatureswarn when pattern synonyms do not have type signatures
-Wmissing-safe-haskell-modewarn when the Safe Haskell mode is not explicitly specified.
-Wmissing-signatureswarn about top-level functions without signatures
-Wmissing-space-after-bang(deprecated) Does nothing
-Wmonomorphism-restrictionwarn when the Monomorphism Restriction is applied
-Wname-shadowingwarn when names are shadowed
-Wno-compatDisables all warnings enabled by
-Wcompat.-Wnoncanonical-monad-instanceswarn when
ApplicativeorMonadinstances have noncanonical definitions ofreturn,pure,(>>), or(*>). See flag description in Warnings and sanity-checking for more details.-Wnoncanonical-monadfail-instances(deprecated) warn when
MonadorMonadFailinstances have noncanonical definitions offail.-Wnoncanonical-monoid-instanceswarn when
SemigrouporMonoidinstances have noncanonical definitions of(<>)ormappend. See flag description in Warnings and sanity-checking for more details.-Wnot(deprecated) Alias for
-w-Woperator-whitespacewarn on prefix, suffix, and tight infix uses of infix operators
-Woperator-whitespace-ext-conflictwarn on uses of infix operators that would be parsed differently were a particular GHC extension enabled
-Worphanswarn when the module contains orphan instance declarations or rewrite rules
-Woverflowed-literalswarn about literals that will overflow their type
-Woverlapping-patternswarn about overlapping patterns
-Wpartial-fieldswarn when defining a partial record field.
-Wpartial-type-signatureswarn about holes in partial type signatures when
PartialTypeSignaturesis enabled. Not applicable whenPartialTypeSignaturesis not enabled, in which case errors are generated for such holes.-Wprepositive-qualified-moduleReport imports with a leading/prepositive "qualified"
-Wredundant-bang-patternsWarn about redundant bang patterns.
-Wredundant-constraintsHave the compiler warn about redundant constraints in type signatures.
-Wredundant-record-wildcardsWarn about record wildcard matches when the wildcard binds no patterns.
-Wsafewarn if the module being compiled is regarded to be safe.
-Wsemigroupwarn when a
Monoidis notSemigroup, and on non-Semigroupdefinitions of(<>)?-Wsimplifiable-class-constraintsWarn about class constraints in a type signature that can be simplified using a top-level instance declaration.
-Wstar-binderwarn about binding the
(*)type operator despiteStarIsType-Wstar-is-typewarn when
*is used to meanData.Kind.Type-Wtabswarn if there are tabs in the source file
-Wtrustworthy-safewarn if the module being compiled is marked as
Trustworthybut it could instead be marked asSafe, a more informative bound.-Wtype-defaultswarn when defaulting happens
-Wtyped-holesReport warnings when typed hole errors are deferred until runtime. See
-fdefer-typed-holes.-Wunbanged-strict-patternswarn on pattern bind of unlifted variable that is neither bare nor banged
-Wunicode-bidirectional-format-characterswarn about the usage of unicode bidirectional layout override characters
-Wunrecognised-pragmaswarn about uses of pragmas that GHC doesn't recognise
-Wunrecognised-warning-flagsthrow a warning when an unrecognised
-W...flag is encountered on the command line.-Wunsafewarn if the module being compiled is regarded to be unsafe. See Safe Haskell
-Wunsupported-calling-conventionswarn about use of an unsupported calling convention
-Wunsupported-llvm-versionWarn when using
-fllvmwith an unsupported version of LLVM.-Wunticked-promoted-constructorswarn if promoted constructors are not ticked
-Wunused-bindswarn about bindings that are unused. Alias for
-Wunused-top-binds,-Wunused-local-bindsand-Wunused-pattern-binds-Wunused-do-bindwarn about do bindings that appear to throw away values of types other than
()-Wunused-forallswarn about type variables in user-written
forall\s that are unused-Wunused-importswarn about unnecessary imports
-Wunused-local-bindswarn about local bindings that are unused
-Wunused-matcheswarn about variables in patterns that aren't used
-Wunused-packageswarn when package is requested on command line, but was never loaded.
-Wunused-pattern-bindswarn about pattern match bindings that are unused
-Wunused-record-wildcardsWarn about record wildcard matches when none of the bound variables are used.
-Wunused-top-bindswarn about top-level bindings that are unused
-Wunused-type-patternswarn about unused type variables which arise from patterns in in type family and data family instances
-Wwarnmake warnings non-fatal
-Wwarnings-deprecationswarn about uses of functions & types that have warnings or deprecated pragmas
-Wwrong-do-bindwarn 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.
See also¶
https://www.haskell.org/ghc the GHC homepage