GHC(1) Glasgow Haskell Compiler GHC(1) NAME ghc - the Glasgow Haskell Compiler 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: .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 ._o object files for "way" ; common ways are: dyn dynamically-linked p built with profiling ._hi interface files for "way" ; common ways are: OPTIONS Code generation -dynamic-too -fasm -fllvm -fbyte-code -fexpose-internal-symbols -fexternal-dynamic-refs -fllvm -fasm -fno-code -fobject-code -fPIC -fPIE -fwrite-interface -split-objs Debugging the compiler -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= -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= -dinline-check= -dlinear-core-lint -dno-debug-output -ddebug-output -dno-typeable-binds -dppr-case-as-let -dppr-cols= -dppr-debug -dppr-user-length -drule-check= -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= -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 C pre-processor -cpp -D[=] -U -I -U Finding imports -i -i[:]* Interactive mode -fbreak-on-error -fno-break-on-error -fbreak-on-exception -fno-break-on-exception -fghci-hist-size= -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 Interface files --show-iface -ddump-hi -ddump-hi-diffs -ddump-minimal-imports Keeping intermediate files -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 Language options -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 Linking options -c -debug -dylib-install-name -dynamic -dynload -eventlog -fcompact-unwind -fkeep-cafs -flink-rts -fno-embed-manifest -fno-gen-manifest -fno-shared-implib -framework -framework-path -fuse-rpaths -fwhole-archive-hs-libs -L -l -main-is -no-hs-main -no-pie -pie -no-rtsopts-suggestions -package -pie -no-pie -rdynamic -rtsopts[=] -shared -split-sections -static -staticlib -threaded -with-rtsopts= Miscellaneous options -fexternal-interpreter -ffamily-application-cache -fno-family-application-cache -fglasgow-exts -fno-glasgow-exts -fno-safe-haskell -ghcversion-file -H -j[] Modes of operation --frontend --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 --show-iface --show-options --supported-extensions --supported-languages --version -V -e -M Individual optimizations -fasm-shortcutting -fno-asm-shortcutting -fbinary-blob-threshold= -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= -fno-liberate-case-threshold -fllvm-pass-vectors-in-regs -floopification -fno-loopification -fmax-inline-alloc-size= -fmax-inline-memcpy-insns= -fmax-inline-memset-insns= -fmax-simplifier-iterations= -fmax-uncovered-patterns= -fmax-worker-args= -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= -fsimplifier-phases= -fsolve-constant-dicts -fno-solve-constant-dicts -fspec-constr -fno-spec-constr -fspec-constr-count= -fno-spec-constr-count -fspec-constr-keen -fno-spec-constr-keen -fspec-constr-threshold= -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= -funbox-small-strict-fields -fno-unbox-small-strict-fields -funbox-strict-fields -fno-unbox-strict-fields -funfolding-case-scaling= -funfolding-case-threshold= -funfolding-creation-threshold= -funfolding-dict-discount= -funfolding-fun-discount= -funfolding-keeness-factor= -funfolding-use-threshold= -fworker-wrapper Optimization levels -O -O1 -O0 -O0 -O2 -O0 -O -O0 Package options -clear-package-db -distrust -distrust-all-packages -fpackage-trust -global-package-db -hide-all-packages -hide-package -ignore-package -no-auto-link-packages -no-global-package-db -no-user-package-db -package -package-db -package-env | -package-id -this-unit-id -trust -user-package-db Phases of compilation -C -c -E -F -S -x Overriding external programs -pgma -pgmc -pgmdll -pgmF -pgmi -pgminstall_name_tool -pgmL -pgml -pgmlc -pgmlibtool -pgmlm -pgmlo -pgmotool -pgmP -pgms -pgmwindres Phase-specific options -opta