Commit 2626debc authored by Ben Gamari's avatar Ben Gamari 🐢

compiler: Qualify imports of Data.List

parent f75c4b5c
......@@ -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
......
......@@ -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
......
......@@ -38,7 +38,7 @@ import FieldLabel
import qualified Data.Data as Data
import Data.Function
import Data.List
import Data.List (find)
{-
************************************************************************
......
......@@ -100,7 +100,7 @@ import FastString
import Control.DeepSeq
import Data.Bits
import Data.Data
import Data.List
import Data.List (sortBy, intercalate)
import Data.Ord
{-
......
......@@ -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
......
......@@ -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
......
......@@ -40,7 +40,7 @@ import DynFlags
import Exception
import Control.Monad
import Data.List
import Data.List ( (\\) )
import Data.Maybe
import Data.IORef
......
......@@ -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
......
......@@ -62,7 +62,7 @@ import SMRep ( roundUpTo )
import Control.Monad
import Data.Maybe
import Data.List
import Data.List ((\\))
#if defined(INTEGER_GMP)
import GHC.Exts
import Data.Array.Base
......
......@@ -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
......
......@@ -164,7 +164,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
......
......@@ -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
......
......@@ -81,7 +81,7 @@ import Outputable
import PprCmm () -- 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
......
......@@ -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
......
......@@ -68,7 +68,7 @@ import UniqFM ( UniqFM, mapUFM, filterUFM )
import MonadUtils
import NameCache
import SrcLoc
import Data.List
import Data.List (intersperse, groupBy, sortBy)
import Data.Ord
import Data.Dynamic
import Data.IORef
......
......@@ -69,7 +69,7 @@ import Unique
import UniqSet
import Outputable
import Data.List
import Data.List (mapAccumL)
import FastString
#include "HsVersions.h"
......
......@@ -69,7 +69,7 @@ import Outputable
import Util
import UniqFM ( pprUniqFM )
import Data.List
import Data.List (mapAccumL)
{-
************************************************************************
......
......@@ -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 )
......
......@@ -70,7 +70,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)
{-
************************************************************************
......
......@@ -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
----------------------
......
......@@ -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
{- *********************************************************************
......
......@@ -81,7 +81,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
{-
......
......@@ -79,7 +79,7 @@ import UniqFM
import UniqSet
import Outputable
import Data.List
import Data.List (mapAccumL)
{-
%************************************************************************
......
......@@ -26,7 +26,7 @@ import Var
import VarEnv
import Util (seqList)
import Data.List
import Data.List (mapAccumL)
{-
%************************************************************************
......
......@@ -16,7 +16,7 @@ import Unique
import UniqSet
import UniqFM
import Data.List
import Data.List (mapAccumL)
import Data.Maybe
......
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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(..) )
......
......@@ -93,7 +93,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
......
Subproject commit f73c482db30a40cfa12074de51335b70a0974931
Subproject commit 9dc203130af88fc983c9014a873a7d46ef9330e8
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment