summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-05-02 00:09:22 +0200
committerBen Gamari <ben@smart-cactus.org>2016-05-02 00:09:22 +0200
commitea34f565d370404f9ea5f8bcf6a8380ffa842c49 (patch)
treea8013e90c24e92d9549d2be80acdd37042c063ce
parenta28611b14930c9fd73b0028857e1ea8c0e64a38a (diff)
downloadhaskell-ea34f565d370404f9ea5f8bcf6a8380ffa842c49.tar.gz
Remove unused equivClassesByUniq
It uses `eltsUFM` so it can introduce nondeterminism, but it isn't used so we can delete it. Test Plan: it builds Reviewers: simonpj, goldfire, simonmar, austin, bgamari Reviewed By: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2161 GHC Trac Issues: #4012
-rw-r--r--compiler/utils/ListSetOps.hs17
1 files changed, 1 insertions, 16 deletions
diff --git a/compiler/utils/ListSetOps.hs b/compiler/utils/ListSetOps.hs
index 207a00cfc1..4113566001 100644
--- a/compiler/utils/ListSetOps.hs
+++ b/compiler/utils/ListSetOps.hs
@@ -15,7 +15,7 @@ module ListSetOps (
-- Duplicate handling
hasNoDups, runs, removeDups, findDupsEq,
- equivClasses, equivClassesByUniq,
+ equivClasses,
-- Indexing
getNth
@@ -24,8 +24,6 @@ module ListSetOps (
#include "HsVersions.h"
import Outputable
-import Unique
-import UniqFM
import Util
import Data.List
@@ -159,16 +157,3 @@ findDupsEq _ [] = []
findDupsEq eq (x:xs) | null eq_xs = findDupsEq eq xs
| otherwise = (x:eq_xs) : findDupsEq eq neq_xs
where (eq_xs, neq_xs) = partition (eq x) xs
-
-equivClassesByUniq :: (a -> Unique) -> [a] -> [[a]]
- -- NB: it's *very* important that if we have the input list [a,b,c],
- -- where a,b,c all have the same unique, then we get back the list
- -- [a,b,c]
- -- not
- -- [c,b,a]
- -- Hence the use of foldr, plus the reversed-args tack_on below
-equivClassesByUniq get_uniq xs
- = eltsUFM (foldr add emptyUFM xs)
- where
- add a ufm = addToUFM_C tack_on ufm (get_uniq a) [a]
- tack_on old new = new++old