aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Types.hs
diff options
context:
space:
mode:
authorIsaac Dupree <id@isaac.cedarswampstudios.org>2009-08-23 07:26:05 +0000
committerIsaac Dupree <id@isaac.cedarswampstudios.org>2009-08-23 07:26:05 +0000
commit7d06f667278dde53285b1abc72701f11f0cccd6f (patch)
tree130a6ec2a06b925b995866b07596753a10d6343a /src/Haddock/Types.hs
parent3a51468aabab2a3f4b9e06e7e0025f2421e07469 (diff)
cross-package fnArgDocs. WARNING: changes .haddock binary format
While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done!
Diffstat (limited to 'src/Haddock/Types.hs')
-rw-r--r--src/Haddock/Types.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs
index 6d53f88d..ac3f2b5f 100644
--- a/src/Haddock/Types.hs
+++ b/src/Haddock/Types.hs
@@ -227,7 +227,7 @@ data InstalledInterface = InstalledInterface {
instInfo :: HaddockModInfo Name,
-- | Everything declared in the module (including subordinates) that has docs
- instDocMap :: Map Name (HsDoc DocName),
+ instDocMap :: Map Name (DocForDecl Name),
-- | All names exported by this module
instExports :: [Name],
@@ -256,13 +256,18 @@ toInstalledIface :: Interface -> InstalledInterface
toInstalledIface interface = InstalledInterface {
instMod = ifaceMod interface,
instInfo = ifaceInfo interface,
- instDocMap = Map.mapMaybe fst $ ifaceRnDocMap interface,--todo.
+ instDocMap = fmap unrenameDocForDecl $ ifaceRnDocMap interface,
instExports = ifaceExports interface,
instVisibleExports = ifaceVisibleExports interface,
instOptions = ifaceOptions interface,
instSubMap = ifaceSubMap interface
}
+unrenameHsDoc :: HsDoc DocName -> HsDoc Name
+unrenameHsDoc = fmapHsDoc getName
+unrenameDocForDecl :: DocForDecl DocName -> DocForDecl Name
+unrenameDocForDecl (mbDoc, fnArgsDoc) =
+ (fmap unrenameHsDoc mbDoc, fmap unrenameHsDoc fnArgsDoc)
#if __GLASGOW_HASKELL__ >= 611
data HsDoc id