From 8a8dc2de3e9004aeadbd35e11f4afed416ff35bf Mon Sep 17 00:00:00 2001 From: alexbiehl Date: Tue, 31 Oct 2017 22:32:31 +0100 Subject: Remove excessive use of list comprehensions --- haddock-api/src/Haddock/Interface/Create.hs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'haddock-api/src') diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 096fdda3..da55397e 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -774,19 +774,14 @@ availExportItem is_sig modMap thisMod semMod warnings exportedNames name = availName avail -- all the exported names for this ExportItem exported_names = availNamesWithSelectors avail - subs' = [ sub - | sub@(sub_name, _) <- subs - , sub_name `elem` exported_names - ] - pats' = [ patsyn - | patsyn@(patsyn_decl, _) <- pats - , all (`elem` exported_names) (getMainDeclBinder patsyn_decl) - ] + is_exported nm = nm `elem` exported_names + + subs' = filter (is_exported . fst) subs sub_names = map fst subs' - pat_names = [ n - | (patsyn_decl, _) <- pats' - , n <- getMainDeclBinder patsyn_decl - ] + + pats' = filter (all is_exported . getMainDeclBinder . fst) pats + pat_names = concatMap (getMainDeclBinder . fst) pats' + fixities = [ (n, f) | n <- name:sub_names ++ pat_names , Just f <- [M.lookup n fixMap] -- cgit v1.2.3