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 | |
parent | 7d452be454857549679b93a0682a3f6fedf5d7c1 (diff) | |
download | haskell-c2e301aeeae353a64be43e5fa9e7d464797d5648.tar.gz |
compiler: Qualify imports of Data.List
Diffstat (limited to 'compiler')
26 files changed, 32 insertions, 32 deletions
diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs index 66416c084c..25b32be0d0 100644 --- a/compiler/GHC/CmmToC.hs +++ b/compiler/GHC/CmmToC.hs @@ -55,7 +55,7 @@ import qualified Data.ByteString as BS import Control.Monad.ST import Data.Bits import Data.Char -import Data.List +import Data.List (intersperse) import Data.Map (Map) import Data.Word import System.IO diff --git a/compiler/GHC/Iface/Utils.hs b/compiler/GHC/Iface/Utils.hs index df3671fad1..c90cfe13a5 100644 --- a/compiler/GHC/Iface/Utils.hs +++ b/compiler/GHC/Iface/Utils.hs @@ -113,7 +113,7 @@ import ExtractDocs import Control.Monad import Data.Function -import Data.List +import Data.List (find, findIndex, mapAccumL, sortBy, sort) import qualified Data.Map as Map import qualified Data.Set as Set import Data.Ord diff --git a/compiler/backpack/DriverBkp.hs b/compiler/backpack/DriverBkp.hs index e8fdba5bd3..ec2700b070 100644 --- a/compiler/backpack/DriverBkp.hs +++ b/compiler/backpack/DriverBkp.hs @@ -54,7 +54,7 @@ import Util import qualified GHC.LanguageExtensions as LangExt import Panic -import Data.List +import Data.List ( partition ) import System.Exit import Control.Monad import System.FilePath diff --git a/compiler/basicTypes/Module.hs b/compiler/basicTypes/Module.hs index 4cd69b786b..9146660254 100644 --- a/compiler/basicTypes/Module.hs +++ b/compiler/basicTypes/Module.hs @@ -146,7 +146,7 @@ import UniqDSet import FastString import Binary import Util -import Data.List +import Data.List (sortBy, sort) import Data.Ord import GHC.PackageDb (BinaryStringRep(..), DbUnitIdModuleRep(..), DbModule(..), DbUnitId(..)) import Fingerprint diff --git a/compiler/basicTypes/PatSyn.hs b/compiler/basicTypes/PatSyn.hs index dddcb51319..e53279f668 100644 --- a/compiler/basicTypes/PatSyn.hs +++ b/compiler/basicTypes/PatSyn.hs @@ -38,7 +38,7 @@ import FieldLabel import qualified Data.Data as Data import Data.Function -import Data.List +import Data.List (find) {- ************************************************************************ diff --git a/compiler/basicTypes/SrcLoc.hs b/compiler/basicTypes/SrcLoc.hs index 57915fd666..4ddbf2b683 100644 --- a/compiler/basicTypes/SrcLoc.hs +++ b/compiler/basicTypes/SrcLoc.hs @@ -98,7 +98,7 @@ import FastString import Control.DeepSeq import Data.Bits import Data.Data -import Data.List +import Data.List (sortBy, intercalate) import Data.Ord {- diff --git a/compiler/ghci/ByteCodeAsm.hs b/compiler/ghci/ByteCodeAsm.hs index 801cdc7068..adf701b7e5 100644 --- a/compiler/ghci/ByteCodeAsm.hs +++ b/compiler/ghci/ByteCodeAsm.hs @@ -55,7 +55,7 @@ import Data.Array.Unsafe( castSTUArray ) import Foreign import Data.Char ( ord ) -import Data.List +import Data.List ( genericLength ) import Data.Map (Map) import Data.Maybe (fromMaybe) import qualified Data.Map as Map diff --git a/compiler/ghci/Debugger.hs b/compiler/ghci/Debugger.hs index 616890a2e6..7bfc4eff4c 100644 --- a/compiler/ghci/Debugger.hs +++ b/compiler/ghci/Debugger.hs @@ -40,7 +40,7 @@ import DynFlags import Exception import Control.Monad -import Data.List +import Data.List ( (\\) ) import Data.Maybe import Data.IORef diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs index 126d2a3aa7..773d396ac9 100644 --- a/compiler/ghci/Linker.hs +++ b/compiler/ghci/Linker.hs @@ -57,7 +57,7 @@ import Control.Monad import Data.Char (isSpace) import Data.IORef -import Data.List +import Data.List (intercalate, isPrefixOf, isSuffixOf, nub, partition) import Data.Maybe import Control.Concurrent.MVar diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index a523ae07bf..9ed5eaef9f 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -62,7 +62,7 @@ import GHC.Runtime.Layout ( roundUpTo ) import Control.Monad import Data.Maybe -import Data.List +import Data.List ((\\)) #if defined(INTEGER_GMP) import GHC.Exts import Data.Array.Base diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 3bfd435b00..24a429b7ae 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -165,7 +165,7 @@ import Stream (Stream) import Util -import Data.List +import Data.List ( nub, isPrefixOf, partition ) import Control.Monad import Data.IORef import System.FilePath as FilePath diff --git a/compiler/main/Plugins.hs b/compiler/main/Plugins.hs index 0d6c2da2ce..cb367b4f67 100644 --- a/compiler/main/Plugins.hs +++ b/compiler/main/Plugins.hs @@ -60,7 +60,7 @@ import GhcMonad import DriverPhases import Module ( ModuleName, Module(moduleName)) import Fingerprint -import Data.List +import Data.List (sort) import Outputable (Outputable(..), text, (<+>)) --Qualified import so we can define a Semigroup instance diff --git a/compiler/nativeGen/CFG.hs b/compiler/nativeGen/CFG.hs index 90573221f8..f5c2a6456f 100644 --- a/compiler/nativeGen/CFG.hs +++ b/compiler/nativeGen/CFG.hs @@ -80,7 +80,7 @@ import Outputable import GHC.Cmm.Ppr () -- For Outputable instances import qualified DynFlags as D -import Data.List +import Data.List (sort, nub, partition) import Data.STRef.Strict import Control.Monad.ST diff --git a/compiler/nativeGen/Reg.hs b/compiler/nativeGen/Reg.hs index 7f69ea01a4..3808434d62 100644 --- a/compiler/nativeGen/Reg.hs +++ b/compiler/nativeGen/Reg.hs @@ -31,7 +31,7 @@ import GhcPrelude import Outputable import Unique import RegClass -import Data.List +import Data.List (intersect) -- | An identifier for a primitive real machine register. type RegNo diff --git a/compiler/simplCore/CoreMonad.hs b/compiler/simplCore/CoreMonad.hs index 45ed5d19c1..672b56e64f 100644 --- a/compiler/simplCore/CoreMonad.hs +++ b/compiler/simplCore/CoreMonad.hs @@ -71,7 +71,7 @@ import NameEnv import SrcLoc import Data.Bifunctor ( bimap ) import ErrUtils (dumpAction) -import Data.List +import Data.List (intersperse, groupBy, sortBy) import Data.Ord import Data.Dynamic import Data.IORef diff --git a/compiler/simplCore/SAT.hs b/compiler/simplCore/SAT.hs index e9a62d530d..23e2b601d3 100644 --- a/compiler/simplCore/SAT.hs +++ b/compiler/simplCore/SAT.hs @@ -69,7 +69,7 @@ import Unique import UniqSet import Outputable -import Data.List +import Data.List (mapAccumL) import FastString #include "HsVersions.h" diff --git a/compiler/simplCore/SimplEnv.hs b/compiler/simplCore/SimplEnv.hs index 0c440efc69..0f2d49f73f 100644 --- a/compiler/simplCore/SimplEnv.hs +++ b/compiler/simplCore/SimplEnv.hs @@ -69,7 +69,7 @@ import Outputable import Util import UniqFM ( pprUniqFM ) -import Data.List +import Data.List (mapAccumL) {- ************************************************************************ diff --git a/compiler/stranal/DmdAnal.hs b/compiler/stranal/DmdAnal.hs index dbe1509b42..2a5eb974aa 100644 --- a/compiler/stranal/DmdAnal.hs +++ b/compiler/stranal/DmdAnal.hs @@ -23,7 +23,7 @@ import CoreSeq ( seqBinds ) import Outputable import VarEnv import BasicTypes -import Data.List +import Data.List ( mapAccumL, sortBy ) import DataCon import Id import CoreUtils ( exprIsHNF, exprType, exprIsTrivial, exprOkForSpeculation ) diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index 8fef838de1..cfa35faa35 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -72,7 +72,7 @@ import qualified GHC.LanguageExtensions as LangExt import Control.Monad import Control.Monad.Trans.Class import Control.Monad.Trans.Reader -import Data.List +import Data.List (partition, find) {- ************************************************************************ diff --git a/compiler/typecheck/TcDerivInfer.hs b/compiler/typecheck/TcDerivInfer.hs index 962305124f..a880916674 100644 --- a/compiler/typecheck/TcDerivInfer.hs +++ b/compiler/typecheck/TcDerivInfer.hs @@ -50,7 +50,7 @@ import VarSet import Control.Monad import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Reader (ask) -import Data.List +import Data.List (sortBy) import Data.Maybe ---------------------- diff --git a/compiler/typecheck/TcEnv.hs b/compiler/typecheck/TcEnv.hs index eedc2f5b3d..eb1e681424 100644 --- a/compiler/typecheck/TcEnv.hs +++ b/compiler/typecheck/TcEnv.hs @@ -112,7 +112,7 @@ import qualified GHC.LanguageExtensions as LangExt import Util ( HasDebugCallStack ) import Data.IORef -import Data.List +import Data.List (intercalate) import Control.Monad {- ********************************************************************* diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 6fd9585e8a..82f073d0a4 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -83,7 +83,7 @@ import UniqSet ( nonDetEltsUniqSet ) import qualified GHC.LanguageExtensions as LangExt import Data.Function -import Data.List +import Data.List (partition, sortBy, groupBy, intersect) import qualified Data.Set as Set {- diff --git a/compiler/types/TyCoSubst.hs b/compiler/types/TyCoSubst.hs index 0d676ed5fa..e15d2d69d7 100644 --- a/compiler/types/TyCoSubst.hs +++ b/compiler/types/TyCoSubst.hs @@ -80,7 +80,7 @@ import UniqFM import UniqSet import Outputable -import Data.List +import Data.List (mapAccumL) {- %************************************************************************ diff --git a/compiler/types/TyCoTidy.hs b/compiler/types/TyCoTidy.hs index 649a7dee11..77dc32c39b 100644 --- a/compiler/types/TyCoTidy.hs +++ b/compiler/types/TyCoTidy.hs @@ -28,7 +28,7 @@ import Var import VarEnv import Util (seqList) -import Data.List +import Data.List (mapAccumL) {- %************************************************************************ 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 |