From: simonmar Date: Fri, 28 Jan 2005 13:54:56 +0000 (+0000) Subject: [project @ 2005-01-28 13:54:56 by simonmar] X-Git-Tag: nhc98-1-18-release~62 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ca6b0a3e29400e95514169cd2735768965be1396;hp=ec3ba94b254bd444e7a1c560c1d91c4879948c69;p=ghc-base.git [project @ 2005-01-28 13:54:56 by simonmar] System.Info now exports: compilerName :: String compilerVersion :: Data.Version.Version as requested ages ago by Template Haskell users. This allows "conditional compilation" based on the GHC version in TH code. I've implemented compilerName for all compilers (I hope). Other compiler vendors are encouraged to provide their own implementations of compilerVersion. --- diff --git a/System/Info.hs b/System/Info.hs index dfb3018..85b9017 100644 --- a/System/Info.hs +++ b/System/Info.hs @@ -18,7 +18,9 @@ module System.Info os, -- :: String arch, -- :: String compilerName, -- :: String +#ifdef __GLASGOW_HASKELL__ compilerVersion -- :: Version +#endif ) where import Prelude @@ -50,8 +52,8 @@ compilerName = "hugs" #error Unknown compiler name #endif -compilerVersion :: Version #ifdef __GLASGOW_HASKELL__ +compilerVersion :: Version compilerVersion = Version {versionBranch=[maj,min], versionTags=[]} where (maj,min) = __GLASGOW_HASKELL__ `divMod` 100 #endif