diff options
author | David Waern <david.waern@gmail.com> | 2008-08-10 22:42:05 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2008-08-10 22:42:05 +0000 |
commit | 6a8d312cdba65a07b923a30cec0de2cc6a3d2da8 (patch) | |
tree | 1e46ecadca219b05c8b5aa56da0bcad6d8c74dcd /src/Haddock/GHC | |
parent | aa3e4fda3d50d16ff1c16ce819d2f264db6211e3 (diff) |
Make H.GHC.Utils build with GHC HEAD
Diffstat (limited to 'src/Haddock/GHC')
-rw-r--r-- | src/Haddock/GHC/Utils.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Haddock/GHC/Utils.hs b/src/Haddock/GHC/Utils.hs index 6de56f88..f0423303 100644 --- a/src/Haddock/GHC/Utils.hs +++ b/src/Haddock/GHC/Utils.hs @@ -12,6 +12,10 @@ module Haddock.GHC.Utils where +#if __GLASGOW_HASKELL__ >= 609 +import Distribution.Text +#endif + import Data.Char import Data.Version import qualified Data.Map as Map @@ -22,6 +26,7 @@ import SrcLoc import Outputable import Name import Packages +import Module unL :: Located a -> a @@ -43,8 +48,12 @@ modulePackageString = packageIdString . modulePackageId -- return the (name,version) of the package modulePackageInfo mod = case unpackPackageId pkg of Nothing -> (packageIdString pkg, "") +#if __GLASGOW_HASKELL__ >= 609 + Just x -> (display $ pkgName x, showVersion (pkgVersion x)) +#else Just x -> (pkgName x, showVersion (pkgVersion x)) - where pkg = modulePackageId mod +#endif + where pkg = modulePackageId mod mkModuleNoPackage :: String -> Module |