diff options
author | panne <unknown> | 2005-01-15 18:44:48 +0000 |
---|---|---|
committer | panne <unknown> | 2005-01-15 18:44:48 +0000 |
commit | 914ccdce1b9923f7fc8f75b3bdb188192291ac9b (patch) | |
tree | 975e0562f4810a89fa7fcc181885f99bd5f5f3c7 /src/HaddockHH.hs | |
parent | e8f54f255a7295fc0da368390706b1ae5d90268c (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/HaddockHH.hs')
-rw-r--r-- | src/HaddockHH.hs | 13 |
1 files changed, 6 insertions, 7 deletions
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 |