summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/GHC/CmmToC.hs2
-rw-r--r--compiler/GHC/Iface/Utils.hs2
-rw-r--r--compiler/backpack/DriverBkp.hs2
-rw-r--r--compiler/basicTypes/Module.hs2
-rw-r--r--compiler/basicTypes/PatSyn.hs2
-rw-r--r--compiler/basicTypes/SrcLoc.hs2
-rw-r--r--compiler/ghci/ByteCodeAsm.hs2
-rw-r--r--compiler/ghci/Debugger.hs2
-rw-r--r--compiler/ghci/Linker.hs2
-rw-r--r--compiler/ghci/RtClosureInspect.hs2
-rw-r--r--compiler/main/HscMain.hs2
-rw-r--r--compiler/main/Plugins.hs2
-rw-r--r--compiler/nativeGen/CFG.hs2
-rw-r--r--compiler/nativeGen/Reg.hs2
-rw-r--r--compiler/simplCore/CoreMonad.hs2
-rw-r--r--compiler/simplCore/SAT.hs2
-rw-r--r--compiler/simplCore/SimplEnv.hs2
-rw-r--r--compiler/stranal/DmdAnal.hs2
-rw-r--r--compiler/typecheck/TcDeriv.hs2
-rw-r--r--compiler/typecheck/TcDerivInfer.hs2
-rw-r--r--compiler/typecheck/TcEnv.hs2
-rw-r--r--compiler/typecheck/TcExpr.hs2
-rw-r--r--compiler/types/TyCoSubst.hs2
-rw-r--r--compiler/types/TyCoTidy.hs2
-rw-r--r--compiler/utils/GraphPpr.hs2
-rw-r--r--compiler/utils/ListSetOps.hs14
-rw-r--r--ghc/Main.hs2
-rw-r--r--libraries/base/Data/Version.hs2
-rw-r--r--libraries/base/Debug/Trace.hs2
-rw-r--r--libraries/base/Prelude.hs32
-rw-r--r--libraries/base/Text/Printf.hs2
31 files changed, 56 insertions, 48 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
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 77d2616bd1..6514a00345 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -80,7 +80,7 @@ import Control.Monad
import Control.Monad.Trans.Class
import Control.Monad.Trans.Except (throwE, runExceptT)
import Data.Char
-import Data.List
+import Data.List ( isPrefixOf, partition, intercalate )
import Data.Maybe
import Prelude
diff --git a/libraries/base/Data/Version.hs b/libraries/base/Data/Version.hs
index 6fb0169d12..6a284642c1 100644
--- a/libraries/base/Data/Version.hs
+++ b/libraries/base/Data/Version.hs
@@ -42,7 +42,7 @@ import Data.Bool ( (&&) )
import Data.Char ( isDigit, isAlphaNum )
import Data.Eq
import Data.Int ( Int )
-import Data.List
+import Data.List ( map, sort, concat, concatMap, intersperse, (++) )
import Data.Ord
import Data.String ( String )
import GHC.Generics
diff --git a/libraries/base/Debug/Trace.hs b/libraries/base/Debug/Trace.hs
index cfeefbc0ae..1b977bae6e 100644
--- a/libraries/base/Debug/Trace.hs
+++ b/libraries/base/Debug/Trace.hs
@@ -53,7 +53,7 @@ import GHC.IO.Encoding
import GHC.Ptr
import GHC.Show
import GHC.Stack
-import Data.List
+import Data.List (null, partition)
-- $setup
-- >>> import Prelude
diff --git a/libraries/base/Prelude.hs b/libraries/base/Prelude.hs
index f7b2fd9c2e..66ea603e72 100644
--- a/libraries/base/Prelude.hs
+++ b/libraries/base/Prelude.hs
@@ -101,25 +101,32 @@ module Prelude (
seq, ($!),
-- * List operations
- map, (++), filter,
- head, last, tail, init, null, length, (!!),
- reverse,
+ List.map, (List.++), List.filter,
+ List.head, List.last, List.tail, List.init, (List.!!),
+ Foldable.null, Foldable.length,
+ List.reverse,
-- *** Special folds
- and, or, any, all,
- concat, concatMap,
+ Foldable.and, Foldable.or, Foldable.any, Foldable.all,
+ Foldable.concat, Foldable.concatMap,
-- ** Building lists
-- *** Scans
- scanl, scanl1, scanr, scanr1,
+ List.scanl, List.scanl1, List.scanr, List.scanr1,
-- *** Infinite lists
- iterate, repeat, replicate, cycle,
+ List.iterate, List.repeat, List.replicate, List.cycle,
-- ** Sublists
- take, drop, splitAt, takeWhile, dropWhile, span, break,
+ List.take, List.drop,
+ List.takeWhile, List.dropWhile,
+ List.span, List.break,
+ List.splitAt,
-- ** Searching lists
- notElem, lookup,
+ Foldable.notElem,
+ List.lookup,
-- ** Zipping and unzipping lists
- zip, zip3, zipWith, zipWith3, unzip, unzip3,
+ List.zip, List.zip3,
+ List.zipWith, List.zipWith3,
+ List.unzip, List.unzip3,
-- ** Functions on strings
- lines, words, unlines, unwords,
+ List.lines, List.words, List.unlines, List.unwords,
-- * Converting to and from @String@
-- ** Converting to @String@
@@ -157,9 +164,10 @@ module Prelude (
import Control.Monad
import System.IO
import System.IO.Error
-import Data.List
+import qualified Data.List as List
import Data.Either
import Data.Foldable ( Foldable(..) )
+import qualified Data.Foldable as Foldable
import Data.Functor ( (<$>) )
import Data.Maybe
import Data.Traversable ( Traversable(..) )
diff --git a/libraries/base/Text/Printf.hs b/libraries/base/Text/Printf.hs
index f8d3f02281..3aeb0be789 100644
--- a/libraries/base/Text/Printf.hs
+++ b/libraries/base/Text/Printf.hs
@@ -94,7 +94,7 @@ module Text.Printf(
import Data.Char
import Data.Int
-import Data.List
+import Data.List (stripPrefix)
import Data.Word
import Numeric
import Numeric.Natural