aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-07-15 09:19:38 +0000
committersimonmar <unknown>2002-07-15 09:19:38 +0000
commitabc0dd597a1c88c9f966b8586d8b1ca8fbabb937 (patch)
treebffbc02e4751c6e73aba044efdc6610be2d81b8e
parent8bb85544c6693505460d581495ffd0fd06249817 (diff)
[haddock @ 2002-07-15 09:19:38 by simonmar]
Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector.
-rw-r--r--src/Main.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 214c0001..dcaf1fcc 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -410,7 +410,7 @@ mkExportItems mod_map this_mod orig_env decl_map sub_map decls
return (concat exps)
where
everything_local_exported = -- everything exported
- return (fullContentsOfThisModule this_mod decl_map)
+ return (fullContentsOfThisModule this_mod decls)
lookupExport (HsEVar x) = declWith x (Just [])
lookupExport (HsEAbs t) = declWith t (Just [])
@@ -449,7 +449,7 @@ mkExportItems mod_map this_mod orig_env decl_map sub_map decls
| otherwise = all_subs_of_qname mod_map t
fullContentsOf m
- | m == this_mod = return (fullContentsOfThisModule this_mod decl_map)
+ | m == this_mod = return (fullContentsOfThisModule this_mod decls)
| otherwise =
case lookupFM mod_map m of
Just iface
@@ -469,10 +469,11 @@ mkExportItems mod_map this_mod orig_env decl_map sub_map decls
Just iface -> lookupFM (iface_decls iface) n
Nothing -> Nothing
-fullContentsOfThisModule mod decl_map =
- map mkExportItem (filter (keepDecl.snd) (fmToList decl_map))
- where mkExportItem (x,HsDocGroup loc lev doc) = ExportGroup lev "" doc
- mkExportItem (x,decl) = ExportDecl (Qual mod x) decl
+fullContentsOfThisModule mod decls =
+ map mkExportItem (filter keepDecl decls)
+ where mkExportItem (HsDocGroup loc lev doc) = ExportGroup lev "" doc
+ mkExportItem decl = ExportDecl (Qual mod x) decl
+ where Just x = declMainBinder decl
keepDecl HsTypeSig{} = True
keepDecl HsTypeDecl{} = True