aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockUtil.hs
diff options
context:
space:
mode:
authorpanne <unknown>2005-01-15 18:44:48 +0000
committerpanne <unknown>2005-01-15 18:44:48 +0000
commit914ccdce1b9923f7fc8f75b3bdb188192291ac9b (patch)
tree975e0562f4810a89fa7fcc181885f99bd5f5f3c7 /src/HaddockUtil.hs
parente8f54f255a7295fc0da368390706b1ae5d90268c (diff)
[haddock @ 2005-01-15 18:44:45 by panne]
Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later.
Diffstat (limited to 'src/HaddockUtil.hs')
-rw-r--r--src/HaddockUtil.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/HaddockUtil.hs b/src/HaddockUtil.hs
index bf326b82..3b8f3a13 100644
--- a/src/HaddockUtil.hs
+++ b/src/HaddockUtil.hs
@@ -30,6 +30,8 @@ import HaddockParse
import HaddockTypes
import HsSyn
+import Map ( Map )
+import qualified Map
import List ( intersect, isSuffixOf, intersperse )
import Maybe
@@ -40,11 +42,9 @@ import Monad
import Char ( isAlpha, isSpace, toUpper, ord )
#if __GLASGOW_HASKELL__ < 503
-import FiniteMap
import IOExts
import URI ( escapeString, unreserved )
#else
-import Data.FiniteMap
import Data.IORef
import System.IO.Unsafe ( unsafePerformIO )
import Network.URI ( escapeString, unreserved )
@@ -385,7 +385,7 @@ isPathSeparator ch =
moduleHtmlFile :: String -> FilePath
moduleHtmlFile mdl =
- case lookupFM html_xrefs (Module mdl) of
+ case Map.lookup (Module mdl) html_xrefs of
Nothing -> mdl ++ ".html"
Just fp0 -> pathJoin [fp0, mdl ++ ".html"]
@@ -460,11 +460,11 @@ escapeStr str = escapeString str unreserved
-- being I'm going to use a write-once global variable.
{-# NOINLINE html_xrefs_ref #-}
-html_xrefs_ref :: IORef (FiniteMap Module FilePath)
+html_xrefs_ref :: IORef (Map Module FilePath)
html_xrefs_ref = unsafePerformIO (newIORef (error "module_map"))
{-# NOINLINE html_xrefs #-}
-html_xrefs :: FiniteMap Module FilePath
+html_xrefs :: Map Module FilePath
html_xrefs = unsafePerformIO (readIORef html_xrefs_ref)
-----------------------------------------------------------------------------