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

ModuleCabal-syntax-3.12.1.0Haskell2010

Distribution.System

Cabal often needs to do slightly different things on specific platforms. You probably know about the os however using that is very inconvenient because it is a string and different Haskell implementations do not agree on using the same strings for the same platforms! (In particular see the controversy over "windows" vs "mingw32"). So to make it more consistent and easy to use we have an OS enumeration.

  • 4 types
  • 8 values

Operating System

2 declarations
datadata OS
#

These are the known OS names: Linux, Windows, OSX ,FreeBSD, OpenBSD, NetBSD, DragonFly ,Solaris, AIX, HPUX, IRIX ,HaLVM ,Hurd ,IOS, Android, Ghcjs, Wasi

The following aliases can also be used:, * Windows aliases: mingw32, win32, cygwin32 * OSX alias: darwin * Hurd alias: gnu * FreeBSD alias: kfreebsdgnu * Solaris alias: solaris2

Instances12Eq, Data, Ord, Read, Show, Generic, …

Machine Architecture

2 declarations
datadata Arch
#

These are the known Arches: I386, X86_64, PPC, PPC64, PPC64LE, Sparc, Sparc64, Arm, AArch64, Mips, SH, IA64, S390, S390X, Alpha, Hppa, Rs6000, M68k, Vax, RISCV64, LoongArch64, JavaScript and Wasm32.

The following aliases can also be used: * PPC alias: powerpc * PPC64 alias : powerpc64 * PPC64LE alias : powerpc64le * Mips aliases: mipsel, mipseb * Arm aliases: armeb, armel * AArch64 aliases: arm64

Instances12Eq, Data, Ord, Read, Show, Generic, …

Platform is a pair of arch and OS

3 declarations
datadata Platform
#

Constructors

Instances12Eq, Data, Ord, Read, Show, Generic, …

The platform Cabal was compiled on. In most cases, LocalBuildInfo.hostPlatform should be used instead (the platform we're targeting).

Internal

2 declarations

Classification

3 declarations

How strict to be when classifying strings into the OS and Arch enums.

The reason we have multiple ways to do the classification is because there are two situations where we need to do it.

For parsing OS and arch names in .cabal files we really want everyone to be referring to the same or arch by the same name. Variety is not a virtue in this case. We don't mind about case though.

For the System.Info.os/arch different Haskell implementations use different names for the same or/arch. Also they tend to distinguish versions of an OS/arch which we just don't care about.

The Compat classification allows us to recognise aliases that are already in common use but it allows us to distinguish them from the canonical name which enables us to warn about such deprecated aliases.