Commit bddecda1 authored by Oleg Grenrus's avatar Oleg Grenrus Committed by Marge Bot
Browse files

Data.List specialization to []

- Remove GHC.OldList
- Remove Data.OldList
- compat-unqualified-imports is no-op
- update haddock submodule
parent 5192183f
Pipeline #33833 canceled with stages
in 37 seconds
......@@ -518,6 +518,8 @@ calculateAvails home_unit iface mod_safe' want_boot imported_by =
-- | Issue a warning if the user imports Data.List without either an import
-- list or `qualified`. This is part of the migration plan for the
-- `Data.List.singleton` proposal. See #17244.
--
-- Currently not used for anything.
warnUnqualifiedImport :: ImportDecl GhcPs -> ModIface -> RnM ()
warnUnqualifiedImport decl iface =
whenWOptM Opt_WarnCompatUnqualifiedImports
......@@ -546,7 +548,8 @@ warnUnqualifiedImport decl iface =
]
-- Modules for which we warn if we see unqualified imports
qualifiedMods = mkModuleSet [ dATA_LIST ]
-- Currently empty.
qualifiedMods = mkModuleSet []
warnRedundantSourceImport :: ModuleName -> SDoc
......
......@@ -260,13 +260,8 @@ of ``-W(no-)*``.
:category:
Warns on qualified imports of core library modules which are subject to
change in future GHC releases. Currently the following modules are covered
by this warning:
- ``Data.List`` due to the future addition of ``Data.List.singleton`` and
specialisation of exports to the ``[]`` type. See the
`mailing list <https://groups.google.com/forum/#!topic/haskell-core-libraries/q3zHLmzBa5E>`_
for details.
change in future GHC releases. Currently there are no modules
covered by this warning.
This warning can be addressed by either adding an explicit import list or
using a ``qualified`` import.
......
......@@ -2271,9 +2271,7 @@ https://gitlab.haskell.org/ghc/ghc/-/issues/17867 for more context.
-- The more general methods of the @Foldable@ class are now exported by the
-- "Prelude" in place of the original List-specific methods (see the
-- [FTP Proposal](https://wiki.haskell.org/Foldable_Traversable_In_Prelude)).
-- The List-specific variants are for now still available in "GHC.OldList", but
-- that module is intended only as a transitional aid, and may be removed in
-- the future.
-- The List-specific variants are still available in "Data.List".
--
-- Surprises can arise from the @Foldable@ instance of the 2-tuple @(a,)@ which
-- now behaves as a 1-element @Foldable@ container in its second slot. In
......
This diff is collapsed.
This diff is collapsed.
......@@ -54,7 +54,7 @@ import GHC.IORef ( IORef, newIORef, readIORef, writeIORef )
import GHC.List ( elem, length )
import GHC.Num ( Num(..) )
import Data.OldList ( delete )
import Data.List ( delete )
import Foreign.Marshal.Alloc ( mallocBytes, reallocBytes, free )
import Foreign.Marshal.Array ( pokeArray, pokeArray0 )
import Foreign.Marshal.Error ( throwIf )
......
......@@ -33,7 +33,7 @@ module GHC.Event.Internal.Types
, Timeout(..)
) where
import Data.OldList (foldl', filter, intercalate, null)
import Data.List (foldl', filter, intercalate, null)
import Data.Bits ((.|.), (.&.))
import Data.Semigroup.Internal (stimesMonoid)
......
......@@ -67,7 +67,7 @@ import Data.Functor (void)
import Data.IORef (IORef, atomicModifyIORef', mkWeakIORef, newIORef, readIORef,
writeIORef)
import Data.Maybe (maybe)
import Data.OldList (partition)
import Data.List (partition)
import GHC.Arr (Array, (!), listArray)
import GHC.Base
import GHC.Conc.Sync (yield)
......
......@@ -104,7 +104,7 @@ import GHC.Exception as E
import GHC.IORef
import GHC.Maybe
import GHC.Word
import GHC.OldList (deleteBy)
import Data.List (deleteBy)
import Foreign
import qualified GHC.Event.Array as A
import GHC.Base
......
......@@ -37,7 +37,7 @@ module GHC.Exception
import GHC.Base
import GHC.Show
import GHC.Stack.Types
import GHC.OldList
import Data.List (intercalate, reverse) -- TODO: remove import list?
import GHC.Prim
import GHC.IO.Unsafe
import {-# SOURCE #-} GHC.Stack.CCS
......
......@@ -126,7 +126,7 @@ import GHC.Stack
import qualified Data.Coerce
import Data.String
import Data.OldList
import Data.List (all, sortBy, span)
import Data.Data
import Data.Ord
import Data.Version ( Version(..), makeVersion )
......
......@@ -27,7 +27,7 @@ import GHC.IO.Encoding.Types
import GHC.IO.Buffer
import Data.Bits
import Data.Maybe
import Data.OldList (lookup)
import Data.List (lookup)
import qualified GHC.IO.Encoding.CodePage.API as API
import GHC.IO.Encoding.CodePage.Table
......
......@@ -54,7 +54,7 @@ import GHC.Show
import GHC.Read
import GHC.Exception
import GHC.IO.Handle.Types
import GHC.OldList ( intercalate )
import Data.List ( intercalate )
import {-# SOURCE #-} GHC.Stack.CCS
import Foreign.C.Types
......
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.OldList
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : experimental
-- Portability : portable
--
-- This legacy module provides access to the list-specialised operations
-- of "Data.List". This module may go away again in future GHC versions and
-- is provided as transitional tool to access some of the list-specialised
-- operations that had to be generalised due to the implementation of the
-- <https://wiki.haskell.org/Foldable_Traversable_In_Prelude Foldable/Traversable-in-Prelude Proposal (FTP)>.
--
-- If the operations needed are available in "GHC.List", it's
-- recommended to avoid importing this module and use "GHC.List"
-- instead for now.
--
-- @since 4.8.0.0
-----------------------------------------------------------------------------
module GHC.OldList (module Data.OldList) where
import Data.OldList
......@@ -76,7 +76,7 @@ module GHC.Windows (
import Data.Bits (finiteBitSize, shiftL, shiftR, (.|.), (.&.))
import Data.Char
import Data.OldList
import Data.List (dropWhileEnd)
import Data.Maybe
import Data.Word
import Data.Int
......
......@@ -255,7 +255,6 @@ Library
GHC.MVar
GHC.Natural
GHC.Num
GHC.OldList
GHC.OverloadedLabels
GHC.Pack
GHC.Profiling
......@@ -324,7 +323,6 @@ Library
Control.Monad.ST.Imp
Control.Monad.ST.Lazy.Imp
Data.Functor.Utils
Data.OldList
Data.Semigroup.Internal
Data.Typeable.Internal
Foreign.ForeignPtr.Imp
......
......@@ -48,6 +48,9 @@
* `fromInteger :: Integer -> Float/Double` now consistently round to the
nearest value, with ties to even.
* Functions in `Data.List` are specialized to list.
`Data.OldList` and `GHC.List` modules are removed.
## 4.15.0.0 *TBA*
* `openFile` now calls the `open` system call with an `interruptible` FFI
......
......@@ -4,7 +4,6 @@ module XPrelude (module X) where
import Control.Monad as X
import Data.Foldable as X
import Data.List as X
import Data.Monoid as X
import Data.Traversable as X
import Prelude as X
......@@ -2,6 +2,9 @@
{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-}
module Main where
import Prelude (Int, String, print, putStr, error,
Eq (..), Ord (..), Num (..), Bool (..))
import Data.List
import Control.Exception
......
......@@ -19,7 +19,7 @@ import Data.Map (Map)
import Data.Bifunctor (second)
import Packed.Bytes (Bytes)
import qualified Data.Char
import qualified GHC.OldList as L
import qualified Data.List as L
import qualified Packed.Bytes.Parser as P
import qualified Packed.Bytes as B
import qualified Data.Semigroup as SG
......
Supports Markdown
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