diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-12-29 21:03:35 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-08 10:17:55 -0500 |
commit | c2e301aeeae353a64be43e5fa9e7d464797d5648 (patch) | |
tree | b5b4b564552c3731079528dadbdc138cafad7498 /compiler/utils | |
parent | 7d452be454857549679b93a0682a3f6fedf5d7c1 (diff) | |
download | haskell-c2e301aeeae353a64be43e5fa9e7d464797d5648.tar.gz |
compiler: Qualify imports of Data.List
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/GraphPpr.hs | 2 | ||||
-rw-r--r-- | compiler/utils/ListSetOps.hs | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/compiler/utils/GraphPpr.hs b/compiler/utils/GraphPpr.hs index c39395eda8..2210d07273 100644 --- a/compiler/utils/GraphPpr.hs +++ b/compiler/utils/GraphPpr.hs @@ -16,7 +16,7 @@ import Unique import UniqSet import UniqFM -import Data.List +import Data.List (mapAccumL) import Data.Maybe diff --git a/compiler/utils/ListSetOps.hs b/compiler/utils/ListSetOps.hs index a8b717df00..85233c9533 100644 --- a/compiler/utils/ListSetOps.hs +++ b/compiler/utils/ListSetOps.hs @@ -28,7 +28,7 @@ import GhcPrelude import Outputable import Util -import Data.List +import qualified Data.List as L import qualified Data.List.NonEmpty as NE import Data.List.NonEmpty (NonEmpty(..)) import qualified Data.Set as S @@ -40,7 +40,7 @@ getNth xs n = ASSERT2( xs `lengthExceeds` n, ppr n $$ ppr xs ) deleteBys :: (a -> a -> Bool) -> [a] -> [a] -> [a] -- (deleteBys eq xs ys) returns xs-ys, using the given equality function -- Just like 'Data.List.delete' but with an equality function -deleteBys eq xs ys = foldl' (flip (deleteBy eq)) xs ys +deleteBys eq xs ys = foldl' (flip (L.deleteBy eq)) xs ys {- ************************************************************************ @@ -153,7 +153,7 @@ equivClasses :: (a -> a -> Ordering) -- Comparison equivClasses _ [] = [] equivClasses _ [stuff] = [stuff :| []] -equivClasses cmp items = NE.groupBy eq (sortBy cmp items) +equivClasses cmp items = NE.groupBy eq (L.sortBy cmp items) where eq a b = case cmp a b of { EQ -> True; _ -> False } @@ -166,7 +166,7 @@ removeDups :: (a -> a -> Ordering) -- Comparison function removeDups _ [] = ([], []) removeDups _ [x] = ([x],[]) removeDups cmp xs - = case (mapAccumR collect_dups [] (equivClasses cmp xs)) of { (dups, xs') -> + = case L.mapAccumR collect_dups [] (equivClasses cmp xs) of { (dups, xs') -> (xs', dups) } where collect_dups :: [NonEmpty a] -> NonEmpty a -> ([NonEmpty a], a) @@ -175,6 +175,6 @@ removeDups cmp xs findDupsEq :: (a->a->Bool) -> [a] -> [NonEmpty a] 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 +findDupsEq eq (x:xs) | L.null eq_xs = findDupsEq eq xs + | otherwise = (x :| eq_xs) : findDupsEq eq neq_xs + where (eq_xs, neq_xs) = L.partition (eq x) xs |