@@ -142,10 +142,11 @@ fetchInfo :: IState -- ^ IState to fetch info from
142142fetchInfo ist nss =
143143 do let originNss = S.fromList nss
144144 info <- nsDict ist
145− let info' = M.map (filter (filterName . (\(n, _, _) -> n))) info
145+ let info' = M.map (filter filterInclude) info
146146 info'' = M.map removeOrphans info'
147− reachedNss = traceNss info'' originNss S.empty
148− return $ M.filterWithKey (\k _ -> S.member k reachedNss) info''
147+ info''' = M.filter (not . null) info''
148+ reachedNss = traceNss info''' originNss S.empty
149+ return $ M.filterWithKey (\k _ -> S.member k reachedNss) info'''
149150
150151
151152-- | Removes loose class methods and data constructors,
@@ -169,6 +170,16 @@ filterName (NS n _) = filterName n
169170filterName _ = False
170171
171172
173+-- | Whether a NsItem should be included in the documentation.
174+-- It must not be Hidden and filterName must return True for the name.
175+-- Also it must have Docs -- without Docs, nothing can be done.
176+filterInclude :: NsItem -- ^ Accessibility to check
177+ -> Bool -- ^ Predicate result
178+filterInclude (name, Just _, Public) | filterName name = True
179+filterInclude (name, Just _, Frozen) | filterName name = True
180+filterInclude _ = False
181+
182+
172183-- | Finds all namespaces indirectly referred by a set of namespaces.
173184-- The NsItems of the namespaces are searched for references.
174185traceNss :: NsDict -- ^ Mappings of namespaces and their contents
@@ -224,7 +235,7 @@ getAccess ist n =
224235 let res = lookupDefAcc n False (tt_ctxt ist)
225236 in case res of
226237 [(_, acc)] -> acc
227− _ -> Public
238+ _ -> Hidden
228239
229240-- | Simple predicate for whether an NsItem has Docs
230241hasDoc :: NsItem -- ^ The NsItem to test
@@ -412,19 +423,15 @@ createNsDoc ist ns content out =
412423 do let tpath = out </> "docs" </> (genRelNsPath ns "html")
413424 dir = takeDirectory tpath
414425 file = takeFileName tpath
415− visible (_, _, Hidden) = False
416− visible _ = True
417426 haveDocs (_, Just d, _) = [d]
418427 haveDocs _ = []
419− -- Do not document private members
420− content' = filter visible content
421428 -- We cannot do anything without a Doc
422− content'' = concatMap haveDocs content'
429+ content' = concatMap haveDocs content
423430 createDirectoryIfMissing True dir
424431 (path, h) <- openTempFile dir file
425432 BS2.hPut h $ renderHtml $ wrapper (Just ns) $ do
426433 H.h1 $ toHtml (nsName2Str ns)
427− H.dl ! class_ "decls" $ forM_ content'' (createOtherDoc ist)
434+ H.dl ! class_ "decls" $ forM_ content' (createOtherDoc ist)
428435 hClose h
429436 renameFile path tpath
430437