HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

GHC.Platform.Ways

Ways

The central concept of a "way" is that all objects in a given program must be compiled in the same "way". Certain options change parameters of the virtual machine, eg. profiling adds an extra word to the object header, so profiling objects cannot be linked with non-profiling objects.

After parsing the command-line options, we determine which "way" we are building - this might be a combination way, eg. profiling+threaded.

There are two kinds of ways: - RTS only: only affect the runtime system (RTS) and don't affect code generation (e.g. threaded, debug) - Full ways: affect code generation and the RTS (e.g. profiling, dynamic linking)

We then find the "build-tag" associated with this way, and this becomes the suffix used to find .hi files and libraries used in this compilation.

  • 2 types
  • 25 values
  • Packageghc-9.10.3
  • Exports27
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceWays.hs
datadata Way
#

A way

Don't change the constructor order as it is used by waysTag to create a unique tag (e.g. thr_debug_p) which is expected by other tools (e.g. Cabal).

Constructors

  • WayCustom String

    for GHC API clients building custom variants

  • WayThreaded

    (RTS only) Multithreaded runtime system

  • WayDebug

    Debugging, enable trace messages and extra checks

  • WayProf

    Profiling, enable cost-centre stacks and profiling reports

  • WayDyn

    Dynamic linking

Instances4Eq, Ord, Read, Show
  • Eq WayDefined in ghc-9.10.3 · GHC.Platform.Ways
  • Ord WayDefined in ghc-9.10.3 · GHC.Platform.Ways
  • Read WayDefined in ghc-9.10.3 · GHC.Platform.Ways
  • Show WayDefined in ghc-9.10.3 · GHC.Platform.Ways
valuewayRTSOnly :: Way -> Bool
#

Return true for ways that only impact the RTS, not the generated code

valuewaysBuildTag :: Ways -> String
#

Unique build-tag associated to a list of ways

RTS only ways are filtered out because they have no impact on the build.

valuertsWays :: Ways -> Ways
#

Filter RTS-only ways (ways that don't have an impact on compilation)

Host GHC ways

7 declarations
valuehostFullWays :: Ways
#

Host "full" ways (i.e. ways that have an impact on the compilation, not RTS only ways).

These ways must be used when compiling codes targeting the internal interpreter.

valuehostIsProfiled :: Bool
#

Consult the RTS to find whether it has been built with profiling enabled.

valuehostIsDynamic :: Bool
#

Consult the RTS to find whether GHC itself has been built with dynamic linking. This can't be statically known at compile-time, because we build both the static and dynamic versions together with -dynamic-too.