summaryrefslogtreecommitdiff
path: root/compiler/hsSyn
diff options
context:
space:
mode:
authorRichard Lupton <richard.lupton@gmail.com>2019-08-17 13:34:51 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-08-19 02:12:00 -0400
commitac79dfe9cb51f38e122af9a404d50aead8a9e8b0 (patch)
treeed4b2acdc3f5613460ee0cffbec4f71bc1df518e /compiler/hsSyn
parent2a394246da84c17e1b5103bde320b8ca4ce1158a (diff)
downloadhaskell-ac79dfe9cb51f38e122af9a404d50aead8a9e8b0.tar.gz
Remove Bag fold specialisations (#16969)
Diffstat (limited to 'compiler/hsSyn')
-rw-r--r--compiler/hsSyn/HsUtils.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs
index 6fd42ae18d..6823aa1553 100644
--- a/compiler/hsSyn/HsUtils.hs
+++ b/compiler/hsSyn/HsUtils.hs
@@ -1000,7 +1000,7 @@ collect_out_binds ps = foldr (collect_binds ps . snd) []
collect_binds :: Bool -> LHsBindsLR (GhcPass p) idR ->
[IdP (GhcPass p)] -> [IdP (GhcPass p)]
-- Collect Ids, or Ids + pattern synonyms, depending on boolean flag
-collect_binds ps binds acc = foldrBag (collect_bind ps . unLoc) acc binds
+collect_binds ps binds acc = foldr (collect_bind ps . unLoc) acc binds
collect_bind :: (SrcSpanLess (LPat p) ~ Pat p , HasSrcSpan (LPat p)) =>
Bool -> HsBindLR p idR -> [IdP p] -> [IdP p]
@@ -1019,7 +1019,7 @@ collect_bind _ (XHsBindsLR _) acc = acc
collectMethodBinders :: LHsBindsLR idL idR -> [Located (IdP idL)]
-- Used exclusively for the bindings of an instance decl which are all FunBinds
-collectMethodBinders binds = foldrBag (get . unLoc) [] binds
+collectMethodBinders binds = foldr (get . unLoc) [] binds
where
get (FunBind { fun_id = f }) fs = f : fs
get _ fs = fs
@@ -1201,7 +1201,7 @@ hsPatSynSelectors :: HsValBinds (GhcPass p) -> [IdP (GhcPass p)]
-- names are collected by collectHsValBinders.
hsPatSynSelectors (ValBinds _ _ _) = panic "hsPatSynSelectors"
hsPatSynSelectors (XValBindsLR (NValBinds binds _))
- = foldrBag addPatSynSelector [] . unionManyBags $ map snd binds
+ = foldr addPatSynSelector [] . unionManyBags $ map snd binds
addPatSynSelector:: LHsBind p -> [IdP p] -> [IdP p]
addPatSynSelector bind sels