From 914ccdce1b9923f7fc8f75b3bdb188192291ac9b Mon Sep 17 00:00:00 2001 From: panne Date: Sat, 15 Jan 2005 18:44:48 +0000 Subject: [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. --- src/HaddockHH.hs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/HaddockHH.hs') diff --git a/src/HaddockHH.hs b/src/HaddockHH.hs index 8ad4dfe2..fb63c872 100644 --- a/src/HaddockHH.hs +++ b/src/HaddockHH.hs @@ -4,17 +4,16 @@ import HsSyn hiding(Doc) #if __GLASGOW_HASKELL__ < 503 import Pretty -import FiniteMap #else import Text.PrettyPrint -import Data.FiniteMap -import Data.Char +import Data.Char ( toUpper ) #endif import Maybe ( fromMaybe ) import HaddockModuleTree import HaddockUtil import HaddockTypes +import qualified Map ppHHContents :: FilePath -> String -> Maybe String -> [ModuleTree] -> IO () @@ -98,10 +97,10 @@ ppHHIndex 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'] + foldl (\m (k,e) -> Map.insertWith (++) k e m) fm [(name, [mdl]) | (name, Qual mdl' _) <- Map.toAscList (iface_env iface), mdl == mdl'] ppList [] = empty ppList ((name,refs):mdls) = @@ -166,7 +165,7 @@ ppHHProject odir doctitle maybe_package ifaces pkg_paths = do ppLibFile fname = text (toPath fname) 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 -- cgit v1.2.3