[commit: haddock] pr-filter-maps: Don't include names with empty subordinates in maps (67af5a5)
git at git.haskell.org
git at git.haskell.org
Tue Nov 28 11:52:41 UTC 2017
- Previous message: [commit: haddock] pr-filter-maps: Don't include names with empty subordinates in maps (67af5a5)
- Next message: [commit: haddock] ghc-head, ghc-head1, headdock-library-1.4.5, ie_avails, master, pr/cabal-desc, v2.18, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13: Lookup fixities for reexports without subordinates (#642) (cf7addb)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Repository : ssh://git@git.haskell.org/haddock
On branch : pr-filter-maps
Link : http://git.haskell.org/haddock.git/commitdiff/67af5a5a92abf34c6e77602d0314489b475fa278
>---------------------------------------------------------------
commit 67af5a5a92abf34c6e77602d0314489b475fa278
Author: Alexander Biehl <abiehl at novomind.com>
Date: Fri Jun 23 12:48:12 2017 +0200
Don't include names with empty subordinates in maps
These are unecessary anyway and just blow up interface size
>---------------------------------------------------------------
67af5a5a92abf34c6e77602d0314489b475fa278
haddock-api/src/Haddock/Interface/Create.hs | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index 0984894..6528d5d 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -317,7 +317,12 @@ mkMaps :: DynFlags
mkMaps dflags gre instances decls =
let
(a, b, c, d) = unzip4 $ map mappings decls
- in (f' $ map (nubByName fst) a , f b, f c, f d, instanceMap)
+ in ( f' (map (nubByName fst) a)
+ , f (filterMapping (not . M.null) b)
+ , f (filterMapping (not . null) c)
+ , f (filterMapping (not . null) d)
+ , instanceMap
+ )
where
f :: (Ord a, Monoid b) => [[(a, b)]] -> Map a b
f = M.fromListWith (<>) . concat
@@ -325,6 +330,9 @@ mkMaps dflags gre instances decls =
f' :: [[(Name, MDoc Name)]] -> Map Name (MDoc Name)
f' = M.fromListWith metaDocAppend . concat
+ filterMapping :: (b -> Bool) -> [[(a, b)]] -> [[(a, b)]]
+ filterMapping p = map (filter (p . snd))
+
mappings :: (LHsDecl Name, [HsDocString])
-> ( [(Name, MDoc Name)]
, [(Name, Map Int (MDoc Name))]
- Previous message: [commit: haddock] pr-filter-maps: Don't include names with empty subordinates in maps (67af5a5)
- Next message: [commit: haddock] ghc-head, ghc-head1, headdock-library-1.4.5, ie_avails, master, pr/cabal-desc, v2.18, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13: Lookup fixities for reexports without subordinates (#642) (cf7addb)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the ghc-commits
mailing list