Commit 3daf0023 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

Set up framework for generalising Data.List to Foldables

This renames the Data.List module to Data.OldList, and puts a new
Data.List module into its place re-exporting all list functions.

The plan is to leave the monomorphic versions of the list functions in
Data.OldList to help smooth the transition.

The new Data.List module then will simply re-export entities from
Data.OldList and Data.Foldable.

This refactoring has been placed in a separate commit to be able to
better isolate any regressions caused by the actual list function
generalisations when implementing #9586

This also updates the haskell2010, haskell98, and array submodules

Reviewed By: austin, ekmett

Differential Revision:
parent 9f7e3633
Subproject commit bfb488592cf5c92a6970eff64b9495970464014b
Subproject commit f7955522c45a6b7da352349381d93be7c38dff35
......@@ -61,7 +61,7 @@ module Data.Foldable (
import Data.Bool
import Data.Either
import Data.Eq
import qualified Data.List as List
import qualified Data.OldList as List
import Data.Maybe
import Data.Monoid
import Data.Ord
This diff is collapsed.
This diff is collapsed.
......@@ -57,7 +57,7 @@ module Data.OldTypeable.Internal {-# DEPRECATED "Use Data.Typeable.Internal inst
import GHC.Base
import GHC.Word
import GHC.Show
import Data.List
import Data.OldList
import GHC.Num
import GHC.Real
import GHC.IORef
......@@ -23,13 +23,12 @@ module GHC.Event.Internal
) where
import Data.Bits ((.|.), (.&.))
import Data.List (foldl', intercalate)
import Data.OldList (foldl', filter, intercalate, null)
import Foreign.C.Error (eINTR, getErrno, throwErrno)
import System.Posix.Types (Fd)
import GHC.Base
import GHC.Num (Num(..))
import GHC.Show (Show(..))
import GHC.List (filter, null)
-- | An I\/O event.
newtype Event = Event Int
......@@ -81,7 +81,7 @@ import GHC.Stack
import qualified Data.Coerce
import Data.String
import Data.List
import Data.OldList
import Data.Data
import Data.Ord
import qualified Debug.Trace
......@@ -148,7 +148,7 @@ import Data.Maybe
import Data.Traversable ( Traversable )
import Data.Tuple
import GHC.Base
import GHC.Base hiding ( foldr )
import Text.Read
import GHC.Enum
import GHC.Num
......@@ -136,6 +136,7 @@ Library
Subproject commit 8d5301d03f2bb945ef3c7d975dcff3a4d93a0adf
Subproject commit 8ab509b674c73df2298d0f356b438d7db52896e6
Subproject commit a97ea9fa765b4d8afe44d92470519719a4ede295
Subproject commit 51ac61ffff22ad23b5c7edc3fcc503af1d88c745
......@@ -32,5 +32,5 @@ class (RealFrac a, Floating a) => RealFloat a where
-- Defined in ‘GHC.Float’
instance RealFloat Float -- Defined in ‘GHC.Float’
instance RealFloat Double -- Defined in ‘GHC.Float’
Data.List.isPrefixOf :: Eq a => [a] -> [a] -> Bool
-- Defined in ‘Data.List’
Data.OldList.isPrefixOf :: Eq a => [a] -> [a] -> Bool
-- Defined in ‘Data.OldList’
......@@ -160,4 +160,4 @@ main = do
roll :: [Word8] -> Integer
roll = foldr (\b a -> a `shiftL` 8 .|. fromIntegral b) 0
roll = GHC.Base.foldr (\b a -> a `shiftL` 8 .|. fromIntegral b) 0
......@@ -7,5 +7,6 @@ T1972.hs:14:3: Warning:
This binding for ‘mapAccumL’ shadows the existing bindings
defined at T1972.hs:16:1
imported from ‘Data.List’ at T1972.hs:7:1-16
(and originally defined in ‘Data.OldList’)
T1972.hs:20:10: Warning: Defined but not used: ‘c’
module T7963a where
import Prelude ()
import Data.OldList
unlines = concat
......@@ -3,6 +3,7 @@ rnfail040.hs:7:12:
Conflicting exports for ‘nub’:
‘module M’ exports ‘M.nub’
imported from ‘Data.List’ at rnfail040.hs:10:2-22
(and originally defined in ‘Data.OldList’)
‘module M’ exports ‘T.nub’
imported from ‘Rnfail040_A’ at rnfail040.hs:11:2-24
(and originally defined at Rnfail040_A.hs:2:3-5)
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