[commit: haddock] local: Fix build and some cleanup. (dd8966e)

David Waern waern at galois.com
Tue Feb 14 02:01:38 CET 2012


Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branch  : local

http://hackage.haskell.org/trac/ghc/changeset/dd8966e6b5525086dd4a6a5bfc5c26f8b094c564

>---------------------------------------------------------------

commit dd8966e6b5525086dd4a6a5bfc5c26f8b094c564
Author: David Waern <david.waern at gmail.com>
Date:   Wed Jan 25 01:04:39 2012 +0100

    Fix build and some cleanup.

>---------------------------------------------------------------

 src/Haddock/Interface/Create.hs |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs
index 9cafbc0..9f1501a 100644
--- a/src/Haddock/Interface/Create.hs
+++ b/src/Haddock/Interface/Create.hs
@@ -528,7 +528,7 @@ mkExportItems
       | m == thisMod, Just ds <- M.lookup n declMap =
           (ds, lookupDocs n docMap argMap subMap)
       | Just iface <- M.lookup m modMap, Just ds <- M.lookup n (ifaceDeclMap iface) =
-          (ds, lookupInstDocs n (ifaceDocMap iface) (ifaceArgMap iface) (ifaceSubMap iface))
+          (ds, lookupDocs n (ifaceDocMap iface) (ifaceArgMap iface) (ifaceSubMap iface))
       | otherwise = ([], (noDocForDecl, []))
       where
         m = nameModule n
@@ -554,11 +554,12 @@ hiValExportItem name doc = do
 
 -- | Lookup docs for a declaration from maps.
 lookupDocs :: Name -> DocMap Name -> ArgMap Name -> SubMap -> (DocForDecl Name, [(Name, DocForDecl Name)])
-lookupDocs name docMap argMap subMap =
-  let lookupArgMap x = maybe M.empty id (M.lookup x argMap) in
-  let doc = (M.lookup name docMap, lookupArgMap name) in
-  let subs = [ (sub, (M.lookup sub docMap, lookupArgMap sub)) | sub <- maybe [] id (M.lookup name subMap) ] in
-  (doc, subs)
+lookupDocs n docMap argMap subMap =
+  let lookupArgDoc x = M.findWithDefault M.empty x argMap in
+  let doc = (M.lookup n docMap, lookupArgDoc n) in
+  let subs = M.findWithDefault [] n subMap in
+  let subDocs = [ (s, (M.lookup s docMap, lookupArgDoc s)) | s <- subs ]
+  in (doc, subDocs)
 
 
 -- | Return all export items produced by an exported module. That is, we're





More information about the Cvs-ghc mailing list