diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2013-09-15 23:05:05 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2013-09-17 09:54:07 +0200 |
commit | 0f5eae0232a86ec57d841a83e6929361e2751270 (patch) | |
tree | 7cc7b87fce8238cd9ff6b65fb0c37f515191aa6e /libraries/base/Data/Version.hs | |
parent | 43ece172e7045d5ba633be6193f3e908eaa81f00 (diff) | |
download | haskell-0f5eae0232a86ec57d841a83e6929361e2751270.tar.gz |
Constant-fold `__GLASGOW_HASKELL__` CPP conditionals
Now that HUGS and NHC specific code has been removed, this commit "folds"
the now redundant `#if((n)def)`s containing `__GLASGOW_HASKELL__`. This
renders `base` officially GHC only.
This commit also removes redundant `{-# LANGUAGE CPP #-}`.
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Diffstat (limited to 'libraries/base/Data/Version.hs')
-rw-r--r-- | libraries/base/Data/Version.hs | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/libraries/base/Data/Version.hs b/libraries/base/Data/Version.hs index 742e051c4a..23d217634e 100644 --- a/libraries/base/Data/Version.hs +++ b/libraries/base/Data/Version.hs @@ -1,5 +1,5 @@ {-# LANGUAGE Trustworthy #-} -{-# LANGUAGE CPP, DeriveDataTypeable #-} +{-# LANGUAGE DeriveDataTypeable #-} ----------------------------------------------------------------------------- -- | @@ -37,12 +37,7 @@ import Prelude -- necessary to get dependencies right import Text.ParserCombinators.ReadP -#if !__GLASGOW_HASKELL__ -import Data.Typeable ( Typeable, TyCon, mkTyCon, mkTyConApp ) -#else import Data.Typeable ( Typeable ) -#endif - import Data.List ( intersperse, sort ) import Control.Monad ( liftM ) import Data.Char ( isDigit, isAlphaNum ) @@ -90,19 +85,7 @@ data Version = -- The interpretation of the list of tags is entirely dependent -- on the entity that this version applies to. } - deriving (Read,Show -#if __GLASGOW_HASKELL__ - ,Typeable -#endif - ) - -#if !__GLASGOW_HASKELL__ -versionTc :: TyCon -versionTc = mkTyCon "Version" - -instance Typeable Version where - typeOf _ = mkTyConApp versionTc [] -#endif + deriving (Read,Show,Typeable) instance Eq Version where v1 == v2 = versionBranch v1 == versionBranch v2 @@ -126,9 +109,7 @@ showVersion (Version branch tags) -- | A parser for versions in the format produced by 'showVersion'. -- -#ifdef __GLASGOW_HASKELL__ parseVersion :: ReadP Version -#endif parseVersion = do branch <- sepBy1 (liftM read $ munch1 isDigit) (char '.') tags <- many (char '-' >> munch1 isAlphaNum) return Version{versionBranch=branch, versionTags=tags} |