aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsimonmar <unknown>2005-02-04 12:15:53 +0000
committersimonmar <unknown>2005-02-04 12:15:53 +0000
commitff7abe5fb218d2101ea073ddd4452c46ebc64eaa (patch)
tree5c1729772b1ac2a3b17c38c14a56c809b7aa6b72 /src
parent0c680c0457c8e4a68f0908483095ca4db9797c72 (diff)
[haddock @ 2005-02-04 12:15:52 by simonmar]
Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity.
Diffstat (limited to 'src')
-rw-r--r--src/HaddockTypes.hs2
-rw-r--r--src/Main.hs6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/HaddockTypes.hs b/src/HaddockTypes.hs
index fafafe40..f005332c 100644
--- a/src/HaddockTypes.hs
+++ b/src/HaddockTypes.hs
@@ -73,7 +73,7 @@ data DocOption
= OptHide -- this module should not appear in the docs
| OptPrune
| OptIgnoreExports -- pretend everything is exported
- | OptNotDefinitive -- not the best place to get docs for things
+ | OptNotHome -- not the best place to get docs for things
-- exported by this module.
deriving (Eq)
diff --git a/src/Main.hs b/src/Main.hs
index 4d067731..b813c67e 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -1048,7 +1048,7 @@ buildGlobalDocEnv ifaces
upd old_env iface
| OptHide `elem` iface_options iface
= old_env
- | OptNotDefinitive `elem` iface_options iface
+ | OptNotHome `elem` iface_options iface
= foldl' keep_old old_env exported_names
| otherwise
= foldl' keep_new old_env exported_names
@@ -1060,7 +1060,8 @@ buildGlobalDocEnv ifaces
not_reexported (UnQual n) = n `notElem` iface_reexported iface
-- UnQual probably shouldn't happen
- keep_old env qnm = Map.insertWith const qnm (Qual mdl nm) env
+ keep_old env qnm = Map.insertWith (\new old -> old)
+ qnm (Qual mdl nm) env
where nm = nameOfQName qnm
keep_new env qnm = Map.insert qnm (Qual mdl nm) env
where nm = nameOfQName qnm
@@ -1166,6 +1167,7 @@ parseOption :: String -> ErrMsgM (Maybe DocOption)
parseOption "hide" = return (Just OptHide)
parseOption "prune" = return (Just OptPrune)
parseOption "ignore-exports" = return (Just OptIgnoreExports)
+parseOption "not-home" = return (Just OptNotHome)
parseOption other = do tell ["Unrecognised option: " ++ other]; return Nothing
-- -----------------------------------------------------------------------------