aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockHH2.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/HaddockHH2.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/HaddockHH2.hs')
-rw-r--r--src/HaddockHH2.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/HaddockHH2.hs b/src/HaddockHH2.hs
index 2555e523..bdd37386 100644
--- a/src/HaddockHH2.hs
+++ b/src/HaddockHH2.hs
@@ -4,18 +4,16 @@ import HsSyn hiding(Doc)
#if __GLASGOW_HASKELL__ < 503
import Pretty
-import FiniteMap
#else
import Text.PrettyPrint
-import Data.FiniteMap
-import Data.List
-import Data.Char
+import Data.Char ( toUpper )
#endif
import Maybe ( fromMaybe )
import HaddockModuleTree
import HaddockUtil
import HaddockTypes
+import qualified Map
ppHH2Contents :: FilePath -> String -> Maybe String -> [ModuleTree] -> IO ()
ppHH2Contents odir doctitle maybe_package tree = do
@@ -88,10 +86,10 @@ ppHH2Index odir maybe_package ifaces = do
package = fromMaybe "pkg" maybe_package
index :: [(HsName, [Module])]
- index = fmToList (foldr getIfaceIndex emptyFM ifaces)
+ index = Map.toAscList (foldr getIfaceIndex Map.empty ifaces)
getIfaceIndex (mdl,iface) fm =
- addListToFM_C (++) fm [(name, [mdl]) | (name, Qual mdl' _) <- fmToList (iface_env iface), mdl == mdl']
+ Map.unionWith (++) (Map.fromListWith (++) [(name, [mdl]) | (name, Qual mdl' _) <- Map.toAscList (iface_env iface), mdl == mdl']) fm
ppList [] = empty
ppList ((name,mdls):vs) =
@@ -146,10 +144,10 @@ ppHH2Files odir maybe_package ifaces pkg_paths = do
ppLibFile fname = text "<File Url=\""<>text (toPath fname)<>text "\"/>"
chars :: [Char]
- chars = keysFM (foldr getIfaceIndex emptyFM ifaces)
+ chars = map fst (Map.toAscList (foldr getIfaceIndex Map.empty ifaces))
getIfaceIndex (mdl,iface) fm =
- addListToFM fm [(toUpper (head (show name)),()) | (name, Qual mdl' _) <- fmToList (iface_env iface), mdl == mdl']
+ Map.union (Map.fromList [(toUpper (head (show name)),()) | (name, Qual mdl' _) <- Map.toAscList (iface_env iface), mdl == mdl']) fm
-----------------------------------------------------------------------------------