diff options
author | Simon Jakobi <simon.jakobi@gmail.com> | 2020-04-04 05:05:16 +0200 |
---|---|---|
committer | Simon Jakobi <simon.jakobi@gmail.com> | 2020-04-05 01:56:55 +0200 |
commit | 32b6005dd052b02313d00e7824ca3ed2e70d8085 (patch) | |
tree | 582081f39fbc729ee46ce7856c3f3bdb9ed4861a | |
parent | 30a63e79c65b023497af4fe2347149382c71829d (diff) | |
download | haskell-wip/sjakobi/foldl-unionManyUniqDSets.tar.gz |
Use foldl' in unionManyUniqDSetswip/sjakobi/foldl-unionManyUniqDSets
-rw-r--r-- | compiler/GHC/Types/Unique/DSet.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Types/Unique/DSet.hs b/compiler/GHC/Types/Unique/DSet.hs index 32d32536df..c87841f138 100644 --- a/compiler/GHC/Types/Unique/DSet.hs +++ b/compiler/GHC/Types/Unique/DSet.hs @@ -81,8 +81,8 @@ unionUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a unionUniqDSets (UniqDSet s) (UniqDSet t) = UniqDSet (plusUDFM s t) unionManyUniqDSets :: [UniqDSet a] -> UniqDSet a -unionManyUniqDSets [] = emptyUniqDSet -unionManyUniqDSets sets = foldr1 unionUniqDSets sets +unionManyUniqDSets [] = emptyUniqDSet +unionManyUniqDSets (x:xs) = foldl' unionUniqDSets x xs minusUniqDSet :: UniqDSet a -> UniqDSet a -> UniqDSet a minusUniqDSet (UniqDSet s) (UniqDSet t) = UniqDSet (minusUDFM s t) |