Commit 81082cf4 authored by Matthew Pickering's avatar Matthew Pickering Committed by Marge Bot
Browse files

Revert "Data.List specialization to []"

This reverts commit bddecda1.

This implements the first step in the plan formulated in #20025 to
improve the communication and migration strategy for the proposed
changes to Data.List.

Requires changing the haddock submodule to update the test output.
parent 0e274c39
Pipeline #44786 canceled with stages
in 32 seconds
......@@ -594,8 +594,6 @@ 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 =
when bad_import $ do
......@@ -627,8 +625,7 @@ warnUnqualifiedImport decl iface =
]
-- Modules for which we warn if we see unqualified imports
-- Currently empty.
qualifiedMods = mkModuleSet []
qualifiedMods = mkModuleSet [ dATA_LIST ]
warnRedundantSourceImport :: ModuleName -> TcRnMessage
......
......@@ -275,8 +275,13 @@ of ``-W(no-)*``.
:since: 8.10
Warns on qualified imports of core library modules which are subject to
change in future GHC releases. Currently there are no modules
covered by this warning.
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.
This warning can be addressed by either adding an explicit import list or
using a ``qualified`` import.
......
......@@ -2454,7 +2454,9 @@ elements in a single pass.
-- 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 still available in "Data.List".
-- 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.
--
-- 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.List ( delete )
import Data.OldList ( 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.List (foldl', filter, intercalate, null)
import Data.OldList (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.List (partition)
import Data.OldList (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 Data.List (deleteBy)
import GHC.OldList (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 Data.List (intercalate, reverse) -- TODO: remove import list?
import GHC.OldList
import GHC.Prim
import GHC.IO.Unsafe
import {-# SOURCE #-} GHC.Stack.CCS
......
......@@ -143,7 +143,7 @@ import GHC.Stack
import qualified Data.Coerce
import Data.String
import Data.List (all, sortBy, span)
import Data.OldList
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.List (lookup)
import Data.OldList (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 Data.List ( intercalate )
import GHC.OldList ( 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.List (dropWhileEnd)
import Data.OldList
import Data.Maybe
import Data.Word
import Data.Int
......
......@@ -254,6 +254,7 @@ Library
GHC.MVar
GHC.Natural
GHC.Num
GHC.OldList
GHC.OverloadedLabels
GHC.Pack
GHC.Profiling
......@@ -324,6 +325,7 @@ Library
Control.Monad.ST.Imp
Control.Monad.ST.Lazy.Imp
Data.Functor.Utils
Data.OldList
Data.Semigroup.Internal
Data.Typeable.Internal
Foreign.ForeignPtr.Imp
......
......@@ -79,9 +79,6 @@
* `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.
* Add `GHC.TypeError` module to contain functionality related to custom type
errors. `TypeError` is re-exported from `GHC.TypeLits` for backwards
compatibility.
......
......@@ -4,6 +4,7 @@ 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,9 +2,6 @@
{-# 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 Data.List as L
import qualified GHC.OldList 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