[Git][ghc/ghc][master] Add most common return values for `os` and `arch`

Marge Bot gitlab at gitlab.haskell.org
Wed Jul 1 19:43:32 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
5c9fabb8 by Hécate at 2020-07-01T15:43:25-04:00
Add most common return values for `os` and `arch`

- - - - -


2 changed files:

- aclocal.m4
- libraries/base/System/Info.hs


Changes:

=====================================
aclocal.m4
=====================================
@@ -1919,7 +1919,9 @@ AC_MSG_CHECKING(for path to top of build tree)
 
 # GHC_CONVERT_CPU(cpu, target_var)
 # --------------------------------
-# converts cpu from gnu to ghc naming, and assigns the result to $target_var
+# Converts cpu from gnu to ghc naming, and assigns the result to $target_var.
+# Should you modify this list, you are invited to reflect the changes in 
+# `libraries/base/System/Info.hs`'s documentation.
 AC_DEFUN([GHC_CONVERT_CPU],[
 case "$1" in
   aarch64*)


=====================================
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"
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5c9fabb82b39aed9e61c6b78c72312b20a568c68

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5c9fabb82b39aed9e61c6b78c72312b20a568c68
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200701/c942b347/attachment-0001.html>


More information about the ghc-commits mailing list