Remove commented types in module export lists
[packages/base.git] / System / Info.hs
1 {-# LANGUAGE Safe #-}
2 {-# LANGUAGE CPP #-}
3
4 -----------------------------------------------------------------------------
5 -- |
6 -- Module : System.Info
7 -- Copyright : (c) The University of Glasgow 2001
8 -- License : BSD-style (see the file libraries/base/LICENSE)
9 --
10 -- Maintainer : libraries@haskell.org
11 -- Stability : experimental
12 -- Portability : portable
13 --
14 -- Information about the characteristics of the host
15 -- system lucky enough to run your program.
16 --
17 -----------------------------------------------------------------------------
18
19 module System.Info
20 (
21 os,
22 arch,
23 compilerName,
24 compilerVersion
25 ) where
26
27 import Prelude
28 import Data.Version
29
30 -- | The version of 'compilerName' with which the program was compiled
31 -- or is being interpreted.
32 compilerVersion :: Version
33 compilerVersion = Version {versionBranch=[major, minor], versionTags=[]}
34 where (major, minor) = compilerVersionRaw `divMod` 100
35
36 -- | The operating system on which the program is running.
37 os :: String
38
39 -- | The machine architecture on which the program is running.
40 arch :: String
41
42 -- | The Haskell implementation with which the program was compiled
43 -- or is being interpreted.
44 compilerName :: String
45
46 compilerVersionRaw :: Int
47
48 #if defined(__NHC__)
49 #include "OSInfo.hs"
50 compilerName = "nhc98"
51 compilerVersionRaw = __NHC__
52
53 #elif defined(__GLASGOW_HASKELL__)
54 #include "ghcplatform.h"
55 os = HOST_OS
56 arch = HOST_ARCH
57 compilerName = "ghc"
58 compilerVersionRaw = __GLASGOW_HASKELL__
59
60 #elif defined(__HUGS__)
61 #include "platform.h"
62 os = HOST_OS
63 arch = HOST_ARCH
64 compilerName = "hugs"
65 compilerVersionRaw = 0 -- ToDo
66
67 #else
68 #error Unknown compiler name
69 #endif
70