aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock
diff options
context:
space:
mode:
authoralexbiehl <alex.biehl@gmail.com>2017-10-31 22:32:31 +0100
committeralexbiehl <alex.biehl@gmail.com>2017-10-31 22:32:31 +0100
commit8a8dc2de3e9004aeadbd35e11f4afed416ff35bf (patch)
tree8e04c080407d473fa8afac90d94656e0000f5c9e /haddock-api/src/Haddock
parent2be7dcf62f945a765ee403f91530e43203efc948 (diff)
Remove excessive use of list comprehensions
Diffstat (limited to 'haddock-api/src/Haddock')
-rw-r--r--haddock-api/src/Haddock/Interface/Create.hs19
1 files changed, 7 insertions, 12 deletions
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]