From 3606ad5fdb8b9c2c3f9a62de1d26702ad41f9a10 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 12 Mar 2014 10:31:31 +0100 Subject: Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. --- src/Haddock/Interface/AttachInstances.hs | 5 ++--- src/Haddock/Interface/Rename.hs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Haddock/Interface') diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs index 60ae4661..a0bac8fc 100644 --- a/src/Haddock/Interface/AttachInstances.hs +++ b/src/Haddock/Interface/AttachInstances.hs @@ -70,13 +70,12 @@ attachToExportItem expInfo iface ifaceMap instIfaceMap export = expItemInstances = case mb_info of Just (_, _, cls_instances, fam_instances) -> - let fam_insts = [ (synifyFamInst i, n) + let fam_insts = [ (synifyFamInst i opaque, n) | i <- sortBy (comparing instFam) fam_instances , let n = instLookup instDocMap (getName i) iface ifaceMap instIfaceMap , not $ isNameHidden expInfo (fi_fam i) , not $ any (isTypeHidden expInfo) (fi_tys i) - -- Should we check for hidden RHS as well? - -- Ideally, in that case the RHS should simply not show up + , let opaque = isTypeHidden expInfo (fi_rhs i) ] cls_insts = [ (synifyInstHead i, instLookup instDocMap n iface ifaceMap instIfaceMap) | let is = [ (instanceHead' i, getName i) | i <- cls_instances ] diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index a5cde195..4160f4f7 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -264,7 +264,7 @@ renameInstHead (className, k, types, rest) = do types' <- mapM renameType types rest' <- case rest of ClassInst cs -> ClassInst <$> mapM renameType cs - TypeInst ts -> TypeInst <$> renameType ts + TypeInst ts -> TypeInst <$> traverse renameType ts DataInst dd -> DataInst <$> renameTyClD dd return (className', k', types', rest') -- cgit v1.2.3