diff options
Diffstat (limited to 'src/Haddock/GHC')
-rw-r--r-- | src/Haddock/GHC/Utils.hs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Haddock/GHC/Utils.hs b/src/Haddock/GHC/Utils.hs index f0423303..549482ef 100644 --- a/src/Haddock/GHC/Utils.hs +++ b/src/Haddock/GHC/Utils.hs @@ -12,15 +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 -import GHC import HsSyn import SrcLoc import Outputable @@ -42,18 +37,20 @@ moduleString = moduleNameString . moduleName -- return the name of the package, with version info +modulePackageString :: Module -> String modulePackageString = packageIdString . modulePackageId -- return the (name,version) of the package -modulePackageInfo mod = case unpackPackageId pkg of +modulePackageInfo :: Module -> (String, [Char]) +modulePackageInfo modu = 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)) #endif - where pkg = modulePackageId mod + where pkg = modulePackageId modu mkModuleNoPackage :: String -> Module |