aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockUtil.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/HaddockUtil.hs')
-rw-r--r--src/HaddockUtil.hs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/HaddockUtil.hs b/src/HaddockUtil.hs
index 99c814f4..b4121752 100644
--- a/src/HaddockUtil.hs
+++ b/src/HaddockUtil.hs
@@ -16,6 +16,7 @@ module HaddockUtil (
basename, dirname, splitFilename3,
moduleHtmlFile, nameHtmlRef,
contentsHtmlFile, indexHtmlFile, subIndexHtmlFile, pathJoin,
+ anchorNameStr,
cssFile, iconFile, jsFile, plusFile, minusFile,
-- * Miscellaneous utilities
@@ -279,7 +280,7 @@ isPathSeparator ch =
moduleHtmlFile :: String -> FilePath
moduleHtmlFile mdl =
- case Map.lookup (Module mdl) html_xrefs of
+ case Map.lookup (GHC.mkModule mdl) html_xrefs of
Nothing -> mdl' ++ ".html"
Just fp0 -> pathJoin [fp0, mdl' ++ ".html"]
where
@@ -288,11 +289,6 @@ moduleHtmlFile mdl =
nameHtmlRef :: String -> GHC.Name -> String
nameHtmlRef mdl str = moduleHtmlFile mdl ++ '#':escapeStr (anchorNameStr str)
-anchorNameStr :: GHC.Name -> String
-anchorNameStr name | isValOcc occName = "v:" ++ getOccString name
- | otherwise = "t:" ++ getOccString name
- where occName = nameOccName name
-
contentsHtmlFile, indexHtmlFile :: String
contentsHtmlFile = "index.html"
indexHtmlFile = "doc-index.html"
@@ -302,6 +298,11 @@ subIndexHtmlFile a = "doc-index-" ++ b ++ ".html"
where b | isAlpha a = [a]
| otherwise = show (ord a)
+anchorNameStr :: Name -> String
+anchorNameStr name | isValOcc occName = "v:" ++ getOccString name
+ | otherwise = "t:" ++ getOccString name
+ where occName = nameOccName name
+
pathJoin :: [FilePath] -> FilePath
pathJoin = foldr join []
where join :: FilePath -> FilePath -> FilePath
@@ -368,11 +369,11 @@ escapeStr = escapeURIString isUnreserved
-- being I'm going to use a write-once global variable.
{-# NOINLINE html_xrefs_ref #-}
-html_xrefs_ref :: IORef (Map Module FilePath)
+html_xrefs_ref :: IORef (Map GHC.Module FilePath)
html_xrefs_ref = unsafePerformIO (newIORef (error "module_map"))
{-# NOINLINE html_xrefs #-}
-html_xrefs :: Map Module FilePath
+html_xrefs :: Map GHC.Module FilePath
html_xrefs = unsafePerformIO (readIORef html_xrefs_ref)
-----------------------------------------------------------------------------