summaryrefslogtreecommitdiff
path: root/libraries/base
diff options
context:
space:
mode:
authorHécate <hecate+gitlab@glitchbra.in>2020-06-27 23:04:19 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-01 15:43:25 -0400
commit5c9fabb82b39aed9e61c6b78c72312b20a568c68 (patch)
tree6ddba373c16a0a2294194cbf78bbb6931af76fac /libraries/base
parentb316804dbafe1d0287fd33f656b7ce5711ec34f7 (diff)
downloadhaskell-5c9fabb82b39aed9e61c6b78c72312b20a568c68.tar.gz
Add most common return values for `os` and `arch`
Diffstat (limited to 'libraries/base')
-rw-r--r--libraries/base/System/Info.hs45
1 files changed, 44 insertions, 1 deletions
diff --git a/libraries/base/System/Info.hs b/libraries/base/System/Info.hs
index c345cf9210..840a9b5a25 100644
--- a/libraries/base/System/Info.hs
+++ b/libraries/base/System/Info.hs
@@ -11,9 +11,11 @@
-- Stability : experimental
-- Portability : portable
--
--- Information about the characteristics of the host
+-- Information about the characteristics of the host
-- system lucky enough to run your program.
--
+-- For a comprehensive listing of supported platforms, please refer to
+-- https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms
-----------------------------------------------------------------------------
module System.Info
@@ -28,6 +30,10 @@ import Data.Version
-- | The version of 'compilerName' with which the program was compiled
-- or is being interpreted.
+--
+-- ==== __Example__
+-- > ghci> compilerVersion
+-- > Version {versionBranch = [8,8], versionTags = []}
compilerVersion :: Version
compilerVersion = Version [major, minor] []
where (major, minor) = compilerVersionRaw `divMod` 100
@@ -35,15 +41,52 @@ compilerVersion = Version [major, minor] []
#include "ghcplatform.h"
-- | The operating system on which the program is running.
+-- Common values include:
+--
+-- * "darwin" — macOS
+-- * "freebsd"
+-- * "linux"
+-- * "linux-android"
+-- * "mingw32" — Windows
+-- * "netbsd"
+-- * "openbsd"
os :: String
os = HOST_OS
-- | The machine architecture on which the program is running.
+-- Common values include:
+--
+-- * "aarch64"
+-- * "alpha"
+-- * "arm"
+-- * "hppa"
+-- * "hppa1_1"
+-- * "i386"
+-- * "ia64"
+-- * "m68k"
+-- * "mips"
+-- * "mipseb"
+-- * "mipsel"
+-- * "nios2"
+-- * "powerpc"
+-- * "powerpc64"
+-- * "powerpc64le"
+-- * "riscv32"
+-- * "riscv64"
+-- * "rs6000"
+-- * "s390"
+-- * "s390x"
+-- * "sh4"
+-- * "sparc"
+-- * "sparc64"
+-- * "vax"
+-- * "x86_64"
arch :: String
arch = HOST_ARCH
-- | The Haskell implementation with which the program was compiled
-- or is being interpreted.
+-- On the GHC platform, the value is "ghc".
compilerName :: String
compilerName = "ghc"