summaryrefslogtreecommitdiff
path: root/libraries/base/Data/Version.hs
diff options
context:
space:
mode:
authorross <unknown>2004-12-01 17:46:14 +0000
committerross <unknown>2004-12-01 17:46:14 +0000
commitdb861fd2a59e7772a68d374fa53bd582d541e379 (patch)
treec9d6967564261afd07c2f7ee30808664824e8bb4 /libraries/base/Data/Version.hs
parent604bd114bcce12f96098be868049e5cb46e66cc1 (diff)
downloadhaskell-db861fd2a59e7772a68d374fa53bd582d541e379.tar.gz
[project @ 2004-12-01 17:46:14 by ross]
tweaks for portability
Diffstat (limited to 'libraries/base/Data/Version.hs')
-rw-r--r--libraries/base/Data/Version.hs20
1 files changed, 14 insertions, 6 deletions
diff --git a/libraries/base/Data/Version.hs b/libraries/base/Data/Version.hs
index 9208746239..fe15c3c638 100644
--- a/libraries/base/Data/Version.hs
+++ b/libraries/base/Data/Version.hs
@@ -37,13 +37,15 @@ import Prelude -- necessary to get dependencies right
-- of GHC. In which case, we might need to pick up ReadP from
-- Distribution.Compat.ReadP, because the version in
-- Text.ParserCombinators.ReadP doesn't have all the combinators we need.
-#if __GLASGOW_HASKELL__ <= 602
-import Distribution.Compat.ReadP
-#else
+#if __GLASGOW_HASKELL__ >= 603 || __HUGS__
import Text.ParserCombinators.ReadP
+#else
+import Distribution.Compat.ReadP
#endif
-#if __GLASGOW_HASKELL__ < 602
+#if !__GLASGOW_HASKELL__
+import Data.Typeable ( Typeable, TyCon, mkTyCon, mkTyConApp )
+#elif __GLASGOW_HASKELL__ < 602
import Data.Dynamic ( Typeable(..), TyCon, mkTyCon, mkAppTy )
#else
import Data.Typeable ( Typeable )
@@ -102,7 +104,13 @@ data Version =
#endif
)
-#if __GLASGOW_HASKELL__ < 602
+#if !__GLASGOW_HASKELL__
+versionTc :: TyCon
+versionTc = mkTyCon "Version"
+
+instance Typeable Version where
+ typeOf _ = mkTyConApp versionTc []
+#elif __GLASGOW_HASKELL__ < 602
versionTc :: TyCon
versionTc = mkTyCon "Version"
@@ -132,7 +140,7 @@ showVersion (Version branch tags)
-- | A parser for versions in the format produced by 'showVersion'.
--
-#if __GLASGOW_HASKELL__ <= 602
+#if __GLASGOW_HASKELL__ <= 602 && !__HUGS__
parseVersion :: ReadP r Version
#else
parseVersion :: ReadP Version