diff options
Diffstat (limited to 'src')
-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 |