diff options
author | Roman Cheplyaka <roma@ro-che.info> | 2012-06-13 14:31:22 +0300 |
---|---|---|
committer | Roman Cheplyaka <roma@ro-che.info> | 2012-07-27 13:00:13 +0300 |
commit | 2cbeae0385bddcd294a5b80a4e2c86b66ff3e1cc (patch) | |
tree | d807dbd5532e94c1b506e7350fceb2062bf81a8c /src/Haddock/Interface.hs | |
parent | 8b71c997072cfc40af62b0557a973e0754e843b6 (diff) |
Hide "internal" instances
This fixes #37 (http://trac.haskell.org/haddock/ticket/37)
Precisely, we show an instance iff its class and all the types are exported by
non-hidden modules.
Diffstat (limited to 'src/Haddock/Interface.hs')
-rw-r--r-- | src/Haddock/Interface.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Haddock/Interface.hs b/src/Haddock/Interface.hs index 09f01883..0003cba2 100644 --- a/src/Haddock/Interface.hs +++ b/src/Haddock/Interface.hs @@ -43,6 +43,7 @@ import Haddock.Utils import Control.Monad import Data.List import qualified Data.Map as Map +import qualified Data.Set as Set import Distribution.Verbosity import System.Directory import System.FilePath @@ -71,8 +72,12 @@ processModules verbosity modules flags extIfaces = do , iface <- ifInstalledIfaces ext ] interfaces <- createIfaces0 verbosity modules flags instIfaceMap + let exportedNames = + Set.unions $ map (Set.fromList . ifaceExports) $ + filter (\i -> not $ OptHide `elem` ifaceOptions i) interfaces + mods = Set.fromList $ map ifaceMod interfaces out verbosity verbose "Attaching instances..." - interfaces' <- attachInstances interfaces instIfaceMap + interfaces' <- attachInstances (exportedNames, mods) interfaces instIfaceMap out verbosity verbose "Building cross-linking environment..." -- Combine the link envs of the external packages into one |