[commit: ghc] master: Remove unused equivClassesByUniq (ea34f56)
git at git.haskell.org
git at git.haskell.org
Sun May 1 22:49:38 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/ea34f565d370404f9ea5f8bcf6a8380ffa842c49/ghc
>---------------------------------------------------------------
commit ea34f565d370404f9ea5f8bcf6a8380ffa842c49
Author: Bartosz Nitka <niteria at gmail.com>
Date: Mon May 2 00:09:22 2016 +0200
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
>---------------------------------------------------------------
ea34f565d370404f9ea5f8bcf6a8380ffa842c49
compiler/utils/ListSetOps.hs | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/compiler/utils/ListSetOps.hs b/compiler/utils/ListSetOps.hs
index 207a00c..4113566 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
More information about the ghc-commits
mailing list