From 60a043541e062ff6ceb52b0ab9e4f67d79dd3754 Mon Sep 17 00:00:00 2001 From: David Waern Date: Wed, 7 Dec 2011 02:16:33 +0100 Subject: Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. --- src/Haddock/Interface/AttachInstances.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/Haddock/Interface/AttachInstances.hs') diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs index 5b7771ec..c012f2e0 100644 --- a/src/Haddock/Interface/AttachInstances.hs +++ b/src/Haddock/Interface/AttachInstances.hs @@ -73,20 +73,17 @@ lookupInstDoc :: Name -> Interface -> IfaceMap -> InstIfaceMap -> Maybe (Doc Nam -- TODO: capture this pattern in a function (when we have streamlined the -- handling of instances) lookupInstDoc name iface ifaceMap instIfaceMap = - case Map.lookup name (ifaceInstanceDocMap iface) of + case Map.lookup name (ifaceDocMap iface) of Just doc -> Just doc Nothing -> case Map.lookup modName ifaceMap of Just iface2 -> - case Map.lookup name (ifaceInstanceDocMap iface2) of + case Map.lookup name (ifaceDocMap iface2) of Just doc -> Just doc Nothing -> Nothing Nothing -> case Map.lookup modName instIfaceMap of - Just instIface -> - case Map.lookup name (instDocMap instIface) of - Just (doc, _) -> doc - Nothing -> Nothing + Just instIface -> Map.lookup name (instDocMap instIface) Nothing -> Nothing where modName = nameModule name -- cgit v1.2.3