Teo Camarasu pushed to branch wip/T26834 at Glasgow Haskell Compiler / GHC

Commits:

23 changed files:

Changes:

  • libraries/base/src/Data/Ord.hs
    ... ... @@ -21,4 +21,5 @@ module Data.Ord
    21 21
          clamp
    
    22 22
          ) where
    
    23 23
     
    
    24
    -import GHC.Internal.Data.Ord
    \ No newline at end of file
    24
    +import GHC.Internal.Data.Ord
    
    25
    +import GHC.Internal.Data.Ord.Down

  • libraries/ghc-internal/ghc-internal.cabal.in
    ... ... @@ -160,6 +160,7 @@ Library
    160 160
             GHC.Internal.Data.NonEmpty
    
    161 161
             GHC.Internal.Data.OldList
    
    162 162
             GHC.Internal.Data.Ord
    
    163
    +        GHC.Internal.Data.Ord.Down
    
    163 164
             GHC.Internal.Data.Proxy
    
    164 165
             GHC.Internal.Data.Semigroup.Internal
    
    165 166
             GHC.Internal.Data.STRef
    
    ... ... @@ -576,4 +577,4 @@ Library
    576 577
         ghc-options: -this-unit-id ghc-internal
    
    577 578
     
    
    578 579
         -- Make sure we don't accidentally regress into anti-patterns
    
    579
    -    ghc-options: -Wcompat -Wnoncanonical-monad-instances
    580
    +    ghc-options: -Wcompat -Wnoncanonical-monad-instances -Werror=unused-imports

  • libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
    ... ... @@ -33,13 +33,13 @@ import GHC.Internal.Data.Maybe
    33 33
     import GHC.Internal.Data.Monoid ( Monoid, Dual(..), Sum(..), Product(..)
    
    34 34
                        , First(..), Last(..), Alt(..), Ap(..) )
    
    35 35
     import GHC.Internal.Data.NonEmpty ( NonEmpty(..) )
    
    36
    -import GHC.Internal.Data.Ord ( Down(..) )
    
    37 36
     import GHC.Internal.Data.Tuple ( Solo(..), snd )
    
    38 37
     import GHC.Internal.Base ( Monad, errorWithoutStackTrace, (.) )
    
    39 38
     import GHC.Internal.Generics
    
    40 39
     import GHC.Internal.List ( head, drop )
    
    41 40
     import GHC.Internal.Control.Monad.ST.Imp
    
    42 41
     import GHC.Internal.System.IO
    
    42
    +import GHC.Internal.Data.Functor.Identity (Identity(..))
    
    43 43
     
    
    44 44
     -- | Monads having fixed points with a \'knot-tying\' semantics.
    
    45 45
     -- Instances of 'MonadFix' should satisfy the following laws:
    
    ... ... @@ -166,8 +166,6 @@ instance (MonadFix f, MonadFix g) => MonadFix (f :*: g) where
    166 166
             fstP (a :*: _) = a
    
    167 167
             sndP (_ :*: b) = b
    
    168 168
     
    
    169
    --- Instances for Data.Ord
    
    170
    -
    
    171
    --- | @since base-4.12.0.0
    
    172
    -instance MonadFix Down where
    
    173
    -    mfix f = Down (fix (getDown . f))
    169
    +-- | @since base-4.8.0.0
    
    170
    +instance MonadFix Identity where
    
    171
    +    mfix f   = Identity (fix (runIdentity . f))

  • libraries/ghc-internal/src/GHC/Internal/Control/Monad/Zip.hs
    ... ... @@ -23,12 +23,11 @@ import GHC.Internal.Data.Functor.Identity
    23 23
     import qualified GHC.Internal.Data.Functor
    
    24 24
     import GHC.Internal.Data.Monoid
    
    25 25
     import GHC.Internal.Data.NonEmpty ( NonEmpty(..) )
    
    26
    -import GHC.Internal.Data.Ord ( Down(..) )
    
    27 26
     import GHC.Internal.Data.Proxy
    
    28 27
     --import qualified Data.List.NonEmpty as NE
    
    29 28
     import GHC.Internal.Generics
    
    30 29
     import qualified GHC.Internal.Data.List.NonEmpty as NE
    
    31
    -import qualified GHC.Internal.Data.List as List
    
    30
    +import qualified GHC.Internal.List as List
    
    32 31
     import GHC.Internal.Data.Maybe
    
    33 32
     import GHC.Internal.Data.Tuple
    
    34 33
     --import Prelude
    
    ... ... @@ -136,9 +135,3 @@ instance MonadZip f => MonadZip (M1 i c f) where
    136 135
     -- | @since 4.9.0.0
    
    137 136
     instance (MonadZip f, MonadZip g) => MonadZip (f :*: g) where
    
    138 137
         mzipWith f (x1 :*: y1) (x2 :*: y2) = mzipWith f x1 x2 :*: mzipWith f y1 y2
    139
    -
    
    140
    --- instances for GHC.Internal.Data.Ord
    
    141
    -
    
    142
    --- | @since 4.12.0.0
    
    143
    -instance MonadZip Down where
    
    144
    -    mzipWith = liftM2

  • libraries/ghc-internal/src/GHC/Internal/Data/Data.hs
    ... ... @@ -116,8 +116,8 @@ import GHC.Internal.Data.Eq
    116 116
     import GHC.Internal.Data.Maybe
    
    117 117
     import GHC.Internal.Data.Monoid
    
    118 118
     import GHC.Internal.Data.NonEmpty ( NonEmpty(..) )
    
    119
    -import GHC.Internal.Data.Ord
    
    120
    -import GHC.Internal.Data.List (findIndex)
    
    119
    +import GHC.Internal.Data.Ord.Down
    
    120
    +import GHC.Internal.Data.OldList (findIndex)
    
    121 121
     import GHC.Internal.Data.Typeable
    
    122 122
     import GHC.Internal.Data.Version( Version(..) )
    
    123 123
     import GHC.Internal.Base hiding (Any, IntRep, FloatRep, NonEmpty(..))
    

  • libraries/ghc-internal/src/GHC/Internal/Data/Foldable.hs
    ... ... @@ -921,9 +921,6 @@ deriving instance Foldable UInt
    921 921
     -- | @since base-4.9.0.0
    
    922 922
     deriving instance Foldable UWord
    
    923 923
     
    
    924
    --- Instances for Data.Ord
    
    925
    --- | @since base-4.12.0.0
    
    926
    -deriving instance Foldable Down
    
    927 924
     
    
    928 925
     -- | Right-to-left monadic fold over the elements of a structure.
    
    929 926
     --
    

  • libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs
    ... ... @@ -33,7 +33,6 @@ module GHC.Internal.Data.Functor.Identity (
    33 33
         Identity(..),
    
    34 34
       ) where
    
    35 35
     
    
    36
    -import GHC.Internal.Control.Monad.Fix
    
    37 36
     import GHC.Internal.Data.Bits (Bits, FiniteBits)
    
    38 37
     import GHC.Internal.Data.Coerce
    
    39 38
     import GHC.Internal.Data.Foldable
    
    ... ... @@ -143,7 +142,3 @@ instance Applicative Identity where
    143 142
     -- | @since base-4.8.0.0
    
    144 143
     instance Monad Identity where
    
    145 144
         m >>= k  = k (runIdentity m)
    146
    -
    
    147
    --- | @since base-4.8.0.0
    
    148
    -instance MonadFix Identity where
    
    149
    -    mfix f   = Identity (fix (runIdentity . f))

  • libraries/ghc-internal/src/GHC/Internal/Data/List/NonEmpty.hs
    ... ... @@ -8,7 +8,7 @@ module GHC.Internal.Data.List.NonEmpty
    8 8
       ) where
    
    9 9
     
    
    10 10
     import GHC.Internal.Data.NonEmpty (NonEmpty (..), map)
    
    11
    -import qualified GHC.Internal.Data.List as List
    
    11
    +import qualified GHC.Internal.List as List
    
    12 12
     
    
    13 13
     -- | The 'zip' function takes two streams and returns a stream of
    
    14 14
     -- corresponding pairs.
    

  • libraries/ghc-internal/src/GHC/Internal/Data/Ord.hs
    ... ... @@ -19,21 +19,11 @@
    19 19
     module GHC.Internal.Data.Ord (
    
    20 20
        Ord(..),
    
    21 21
        Ordering(..),
    
    22
    -   Down(..),
    
    23 22
        comparing,
    
    24 23
        clamp,
    
    25 24
      ) where
    
    26 25
     
    
    27
    -import GHC.Internal.Data.Bits (Bits, FiniteBits, complement)
    
    28
    -import GHC.Internal.Foreign.Storable (Storable)
    
    29
    -import GHC.Internal.Ix (Ix)
    
    30 26
     import GHC.Internal.Base
    
    31
    -import GHC.Internal.Enum (Bounded(..), Enum(..))
    
    32
    -import GHC.Internal.Float (Floating, RealFloat)
    
    33
    -import GHC.Internal.Num
    
    34
    -import GHC.Internal.Read
    
    35
    -import GHC.Internal.Real (Fractional, Real, RealFrac)
    
    36
    -import GHC.Internal.Show
    
    37 27
     
    
    38 28
     -- $setup
    
    39 29
     -- >>> import Prelude
    
    ... ... @@ -68,115 +58,3 @@ comparing p x y = compare (p x) (p y)
    68 58
     -- @since base-4.16.0.0
    
    69 59
     clamp :: (Ord a) => (a, a) -> a -> a
    
    70 60
     clamp (low, high) a = min high (max a low)
    71
    -
    
    72
    --- | The 'Down' type allows you to reverse sort order conveniently.  A value of type
    
    73
    --- @'Down' a@ contains a value of type @a@ (represented as @'Down' a@).
    
    74
    ---
    
    75
    --- If @a@ has an @'Ord'@ instance associated with it then comparing two
    
    76
    --- values thus wrapped will give you the opposite of their normal sort order.
    
    77
    --- This is particularly useful when sorting in generalised list comprehensions,
    
    78
    --- as in: @then sortWith by 'Down' x@.
    
    79
    ---
    
    80
    --- >>> compare True False
    
    81
    --- GT
    
    82
    ---
    
    83
    --- >>> compare (Down True) (Down False)
    
    84
    --- LT
    
    85
    ---
    
    86
    --- If @a@ has a @'Bounded'@ instance then the wrapped instance also respects
    
    87
    --- the reversed ordering by exchanging the values of @'minBound'@ and
    
    88
    --- @'maxBound'@.
    
    89
    ---
    
    90
    --- >>> minBound :: Int
    
    91
    --- -9223372036854775808
    
    92
    ---
    
    93
    --- >>> minBound :: Down Int
    
    94
    --- Down 9223372036854775807
    
    95
    ---
    
    96
    --- All other instances of @'Down' a@ behave as they do for @a@.
    
    97
    ---
    
    98
    --- @since base-4.6.0.0
    
    99
    -newtype Down a = Down
    
    100
    -    { getDown :: a -- ^ @since base-4.14.0.0
    
    101
    -    }
    
    102
    -    deriving
    
    103
    -      ( Eq        -- ^ @since base-4.6.0.0
    
    104
    -      , Num       -- ^ @since base-4.11.0.0
    
    105
    -      , Semigroup -- ^ @since base-4.11.0.0
    
    106
    -      , Monoid    -- ^ @since base-4.11.0.0
    
    107
    -      , Bits       -- ^ @since base-4.14.0.0
    
    108
    -      , FiniteBits -- ^ @since base-4.14.0.0
    
    109
    -      , Floating   -- ^ @since base-4.14.0.0
    
    110
    -      , Fractional -- ^ @since base-4.14.0.0
    
    111
    -      , Ix         -- ^ @since base-4.14.0.0
    
    112
    -      , Real       -- ^ @since base-4.14.0.0
    
    113
    -      , RealFrac   -- ^ @since base-4.14.0.0
    
    114
    -      , RealFloat  -- ^ @since base-4.14.0.0
    
    115
    -      , Storable   -- ^ @since base-4.14.0.0
    
    116
    -      )
    
    117
    -
    
    118
    --- | This instance would be equivalent to the derived instances of the
    
    119
    --- 'Down' newtype if the 'getDown' field were removed
    
    120
    ---
    
    121
    --- @since base-4.7.0.0
    
    122
    -instance (Read a) => Read (Down a) where
    
    123
    -    readsPrec d = readParen (d > 10) $ \ r ->
    
    124
    -        [(Down x,t) | ("Down",s) <- lex r, (x,t) <- readsPrec 11 s]
    
    125
    -
    
    126
    --- | This instance would be equivalent to the derived instances of the
    
    127
    --- 'Down' newtype if the 'getDown' field were removed
    
    128
    ---
    
    129
    --- @since base-4.7.0.0
    
    130
    -instance (Show a) => Show (Down a) where
    
    131
    -    showsPrec d (Down x) = showParen (d > 10) $
    
    132
    -        showString "Down " . showsPrec 11 x
    
    133
    -
    
    134
    --- | @since base-4.6.0.0
    
    135
    -instance Ord a => Ord (Down a) where
    
    136
    -    compare (Down x) (Down y) = y `compare` x
    
    137
    -    Down x < Down y = y < x
    
    138
    -    Down x > Down y = y > x
    
    139
    -    Down x <= Down y = y <= x
    
    140
    -    Down x >= Down y = y >= x
    
    141
    -    min (Down x) (Down y) = Down (max y x)
    
    142
    -    max (Down x) (Down y) = Down (min y x)
    
    143
    -
    
    144
    --- | Swaps @'minBound'@ and @'maxBound'@ of the underlying type.
    
    145
    ---
    
    146
    --- @since base-4.14.0.0
    
    147
    -instance Bounded a => Bounded (Down a) where
    
    148
    -    minBound = Down maxBound
    
    149
    -    maxBound = Down minBound
    
    150
    -
    
    151
    --- | Swaps @'succ'@ and @'pred'@ of the underlying type.
    
    152
    ---
    
    153
    --- @since base-4.18.0.0
    
    154
    -instance (Enum a, Bounded a, Eq a) => Enum (Down a) where
    
    155
    -    succ = fmap pred
    
    156
    -    pred = fmap succ
    
    157
    -
    
    158
    -    -- Here we use the fact that 'comparing (complement @Int)' behaves
    
    159
    -    -- as an order-swapping `compare @Int`.
    
    160
    -    fromEnum = complement . fromEnum . getDown
    
    161
    -    toEnum = Down . toEnum . complement
    
    162
    -
    
    163
    -    enumFrom (Down x)
    
    164
    -        | x == minBound
    
    165
    -        = [Down x] -- We can't rely on 'enumFromThen _ (pred @a minBound)` behaving nicely,
    
    166
    -                   -- since 'enumFromThen _' might be strict and 'pred minBound' might throw
    
    167
    -        | otherwise
    
    168
    -        = coerce $ enumFromThen x (pred x)
    
    169
    -    enumFromThen (Down x) (Down y) = coerce $ enumFromThen x y
    
    170
    -
    
    171
    --- | @since base-4.11.0.0
    
    172
    -instance Functor Down where
    
    173
    -    fmap = coerce
    
    174
    -
    
    175
    --- | @since base-4.11.0.0
    
    176
    -instance Applicative Down where
    
    177
    -    pure = Down
    
    178
    -    (<*>) = coerce
    
    179
    -
    
    180
    --- | @since base-4.11.0.0
    
    181
    -instance Monad Down where
    
    182
    -    Down a >>= k = k a

  • libraries/ghc-internal/src/GHC/Internal/Data/Ord/Down.hs
    1
    +{-# LANGUAGE Trustworthy #-}
    
    2
    +{-# LANGUAGE NoImplicitPrelude #-}
    
    3
    +{-# LANGUAGE GeneralizedNewtypeDeriving #-}
    
    4
    +{-# LANGUAGE DeriveGeneric #-}
    
    5
    +{-# LANGUAGE DeriveFoldable #-}
    
    6
    +{-# LANGUAGE DeriveTraversable #-}
    
    7
    +{-# LANGUAGE StandaloneDeriving #-}
    
    8
    +
    
    9
    +-----------------------------------------------------------------------------
    
    10
    +-- |
    
    11
    +-- Module      :  GHC.Internal.Data.Ord.Down
    
    12
    +-- Copyright   :  (c) The University of Glasgow 2005
    
    13
    +-- License     :  BSD-style (see the file libraries/base/LICENSE)
    
    14
    +--
    
    15
    +-- Maintainer  :  libraries@haskell.org
    
    16
    +-- Stability   :  stable
    
    17
    +-- Portability :  portable
    
    18
    +--
    
    19
    +-- Orderings
    
    20
    +--
    
    21
    +-----------------------------------------------------------------------------
    
    22
    +
    
    23
    +module GHC.Internal.Data.Ord.Down (
    
    24
    +   Down(..),
    
    25
    + ) where
    
    26
    +
    
    27
    +import GHC.Internal.Data.Bits (Bits, FiniteBits, complement)
    
    28
    +import GHC.Internal.Ix (Ix)
    
    29
    +import GHC.Internal.Foreign.Storable (Storable)
    
    30
    +import GHC.Internal.Base
    
    31
    +import GHC.Internal.Enum (Bounded(..), Enum(..))
    
    32
    +import GHC.Internal.Float (Floating, RealFloat)
    
    33
    +import GHC.Internal.Num
    
    34
    +import GHC.Internal.Read
    
    35
    +import GHC.Internal.Real (Fractional, Real, RealFrac)
    
    36
    +import GHC.Internal.Show
    
    37
    +import GHC.Internal.Generics
    
    38
    +import GHC.Internal.Data.Foldable
    
    39
    +import GHC.Internal.Data.Traversable
    
    40
    +import GHC.Internal.Control.Monad.Zip
    
    41
    +
    
    42
    +-- $setup
    
    43
    +-- >>> import Prelude
    
    44
    +
    
    45
    +-- | The 'Down' type allows you to reverse sort order conveniently.  A value of type
    
    46
    +-- @'Down' a@ contains a value of type @a@ (represented as @'Down' a@).
    
    47
    +--
    
    48
    +-- If @a@ has an @'Ord'@ instance associated with it then comparing two
    
    49
    +-- values thus wrapped will give you the opposite of their normal sort order.
    
    50
    +-- This is particularly useful when sorting in generalised list comprehensions,
    
    51
    +-- as in: @then sortWith by 'Down' x@.
    
    52
    +--
    
    53
    +-- >>> compare True False
    
    54
    +-- GT
    
    55
    +--
    
    56
    +-- >>> compare (Down True) (Down False)
    
    57
    +-- LT
    
    58
    +--
    
    59
    +-- If @a@ has a @'Bounded'@ instance then the wrapped instance also respects
    
    60
    +-- the reversed ordering by exchanging the values of @'minBound'@ and
    
    61
    +-- @'maxBound'@.
    
    62
    +--
    
    63
    +-- >>> minBound :: Int
    
    64
    +-- -9223372036854775808
    
    65
    +--
    
    66
    +-- >>> minBound :: Down Int
    
    67
    +-- Down 9223372036854775807
    
    68
    +--
    
    69
    +-- All other instances of @'Down' a@ behave as they do for @a@.
    
    70
    +--
    
    71
    +-- @since base-4.6.0.0
    
    72
    +newtype Down a = Down
    
    73
    +    { getDown :: a -- ^ @since base-4.14.0.0
    
    74
    +    }
    
    75
    +    deriving
    
    76
    +      ( Eq        -- ^ @since base-4.6.0.0
    
    77
    +      , Num       -- ^ @since base-4.11.0.0
    
    78
    +      , Semigroup -- ^ @since base-4.11.0.0
    
    79
    +      , Monoid    -- ^ @since base-4.11.0.0
    
    80
    +      , Bits       -- ^ @since base-4.14.0.0
    
    81
    +      , FiniteBits -- ^ @since base-4.14.0.0
    
    82
    +      , Floating   -- ^ @since base-4.14.0.0
    
    83
    +      , Fractional -- ^ @since base-4.14.0.0
    
    84
    +      , Ix         -- ^ @since base-4.14.0.0
    
    85
    +      , Real       -- ^ @since base-4.14.0.0
    
    86
    +      , RealFrac   -- ^ @since base-4.14.0.0
    
    87
    +      , RealFloat  -- ^ @since base-4.14.0.0
    
    88
    +      , Storable   -- ^ @since base-4.14.0.0
    
    89
    +      , Generic    -- ^ @since base-4.12.0.0
    
    90
    +      )
    
    91
    +
    
    92
    +-- | @since base-4.12.0.0
    
    93
    +deriving instance Generic1 Down
    
    94
    +
    
    95
    +-- | @since base-4.12.0.0
    
    96
    +deriving instance Foldable Down
    
    97
    +
    
    98
    +-- | @since base-4.12.0.0
    
    99
    +deriving instance Traversable Down
    
    100
    +
    
    101
    +-- | @since 4.12.0.0
    
    102
    +instance MonadZip Down where
    
    103
    +    mzipWith = liftM2
    
    104
    +
    
    105
    +-- | This instance would be equivalent to the derived instances of the
    
    106
    +-- 'Down' newtype if the 'getDown' field were removed
    
    107
    +--
    
    108
    +-- @since base-4.7.0.0
    
    109
    +instance (Read a) => Read (Down a) where
    
    110
    +    readsPrec d = readParen (d > 10) $ \ r ->
    
    111
    +        [(Down x,t) | ("Down",s) <- lex r, (x,t) <- readsPrec 11 s]
    
    112
    +
    
    113
    +-- | This instance would be equivalent to the derived instances of the
    
    114
    +-- 'Down' newtype if the 'getDown' field were removed
    
    115
    +--
    
    116
    +-- @since base-4.7.0.0
    
    117
    +instance (Show a) => Show (Down a) where
    
    118
    +    showsPrec d (Down x) = showParen (d > 10) $
    
    119
    +        showString "Down " . showsPrec 11 x
    
    120
    +
    
    121
    +-- | @since base-4.6.0.0
    
    122
    +instance Ord a => Ord (Down a) where
    
    123
    +    compare (Down x) (Down y) = y `compare` x
    
    124
    +    Down x < Down y = y < x
    
    125
    +    Down x > Down y = y > x
    
    126
    +    Down x <= Down y = y <= x
    
    127
    +    Down x >= Down y = y >= x
    
    128
    +    min (Down x) (Down y) = Down (max y x)
    
    129
    +    max (Down x) (Down y) = Down (min y x)
    
    130
    +
    
    131
    +-- | Swaps @'minBound'@ and @'maxBound'@ of the underlying type.
    
    132
    +--
    
    133
    +-- @since base-4.14.0.0
    
    134
    +instance Bounded a => Bounded (Down a) where
    
    135
    +    minBound = Down maxBound
    
    136
    +    maxBound = Down minBound
    
    137
    +
    
    138
    +-- | Swaps @'succ'@ and @'pred'@ of the underlying type.
    
    139
    +--
    
    140
    +-- @since base-4.18.0.0
    
    141
    +instance (Enum a, Bounded a, Eq a) => Enum (Down a) where
    
    142
    +    succ = fmap pred
    
    143
    +    pred = fmap succ
    
    144
    +
    
    145
    +    -- Here we use the fact that 'comparing (complement @Int)' behaves
    
    146
    +    -- as an order-swapping `compare @Int`.
    
    147
    +    fromEnum = complement . fromEnum . getDown
    
    148
    +    toEnum = Down . toEnum . complement
    
    149
    +
    
    150
    +    enumFrom (Down x)
    
    151
    +        | x == minBound
    
    152
    +        = [Down x] -- We can't rely on 'enumFromThen _ (pred @a minBound)` behaving nicely,
    
    153
    +                   -- since 'enumFromThen _' might be strict and 'pred minBound' might throw
    
    154
    +        | otherwise
    
    155
    +        = coerce $ enumFromThen x (pred x)
    
    156
    +    enumFromThen (Down x) (Down y) = coerce $ enumFromThen x y
    
    157
    +
    
    158
    +-- | @since base-4.11.0.0
    
    159
    +instance Functor Down where
    
    160
    +    fmap = coerce
    
    161
    +
    
    162
    +-- | @since base-4.11.0.0
    
    163
    +instance Applicative Down where
    
    164
    +    pure = Down
    
    165
    +    (<*>) = coerce
    
    166
    +
    
    167
    +-- | @since base-4.11.0.0
    
    168
    +instance Monad Down where
    
    169
    +    Down a >>= k = k a

  • libraries/ghc-internal/src/GHC/Internal/Data/String.hs
    ... ... @@ -35,7 +35,7 @@ module GHC.Internal.Data.String (
    35 35
     import GHC.Internal.Base
    
    36 36
     import GHC.Internal.Data.Functor.Const (Const (Const))
    
    37 37
     import GHC.Internal.Data.Functor.Identity (Identity (Identity))
    
    38
    -import GHC.Internal.Data.List (lines, words, unlines, unwords)
    
    38
    +import GHC.Internal.Data.OldList (lines, words, unlines, unwords)
    
    39 39
     
    
    40 40
     -- | `IsString` is used in combination with the @-XOverloadedStrings@
    
    41 41
     -- language extension to convert the literals to different string types.
    

  • libraries/ghc-internal/src/GHC/Internal/Data/Traversable.hs
    ... ... @@ -46,7 +46,6 @@ import GHC.Internal.Data.Functor.Identity ( Identity(..) )
    46 46
     import GHC.Internal.Data.Functor.Utils ( StateL(..), StateR(..), StateT(..), (#.) )
    
    47 47
     import GHC.Internal.Data.Monoid ( Dual(..), Sum(..), Product(..),
    
    48 48
                          First(..), Last(..), Alt(..), Ap(..) )
    
    49
    -import GHC.Internal.Data.Ord ( Down(..) )
    
    50 49
     import GHC.Internal.Data.Proxy ( Proxy(..) )
    
    51 50
     
    
    52 51
     import GHC.Internal.Arr
    
    ... ... @@ -364,10 +363,6 @@ deriving instance Traversable UInt
    364 363
     -- | @since base-4.9.0.0
    
    365 364
     deriving instance Traversable UWord
    
    366 365
     
    
    367
    --- Instance for Data.Ord
    
    368
    --- | @since base-4.12.0.0
    
    369
    -deriving instance Traversable Down
    
    370
    -
    
    371 366
     -- general functions
    
    372 367
     
    
    373 368
     -- | 'for' is 'traverse' with its arguments flipped. For a version
    

  • libraries/ghc-internal/src/GHC/Internal/Data/Version.hs
    ... ... @@ -40,7 +40,7 @@ import GHC.Internal.Data.Functor ( Functor(..) )
    40 40
     import GHC.Internal.Data.Bool        ( (&&) )
    
    41 41
     import GHC.Internal.Data.Eq
    
    42 42
     import GHC.Internal.Int              ( Int )
    
    43
    -import GHC.Internal.Data.List        ( map, sort, concat, concatMap, intersperse, (++) )
    
    43
    +import GHC.Internal.Data.OldList     ( map, sort, concat, concatMap, intersperse, (++) )
    
    44 44
     import GHC.Internal.Data.Ord
    
    45 45
     import GHC.Internal.Data.String      ( String )
    
    46 46
     import GHC.Internal.Base             ( Applicative(..) )
    

  • libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc
    ... ... @@ -103,7 +103,7 @@ import GHC.Internal.IORef
    103 103
     import GHC.Internal.Maybe
    
    104 104
     import GHC.Internal.Ptr
    
    105 105
     import GHC.Internal.Word
    
    106
    -import GHC.Internal.Data.OldList (deleteBy)
    
    106
    +import GHC.Internal.List (deleteBy)
    
    107 107
     import qualified GHC.Internal.Event.Array    as A
    
    108 108
     import GHC.Internal.Base
    
    109 109
     import GHC.Internal.Conc.Bound
    

  • libraries/ghc-internal/src/GHC/Internal/ExecutionStack/Internal.hsc
    ... ... @@ -39,7 +39,7 @@ module GHC.Internal.ExecutionStack.Internal (
    39 39
     
    
    40 40
     import GHC.Internal.Data.Functor
    
    41 41
     import GHC.Internal.Data.Maybe
    
    42
    -import GHC.Internal.Data.List (reverse, null)
    
    42
    +import GHC.Internal.List (reverse, null)
    
    43 43
     import GHC.Internal.Word
    
    44 44
     import GHC.Internal.Foreign.C.Types
    
    45 45
     import GHC.Internal.Foreign.C.String (peekCString, CString)
    

  • libraries/ghc-internal/src/GHC/Internal/Exts.hs
    ... ... @@ -318,7 +318,7 @@ import qualified GHC.Internal.Data.Coerce
    318 318
     import GHC.Internal.Data.String
    
    319 319
     import GHC.Internal.Data.OldList
    
    320 320
     import GHC.Internal.Data.Data
    
    321
    -import GHC.Internal.Data.Ord
    
    321
    +import GHC.Internal.Data.Ord.Down
    
    322 322
     import qualified GHC.Internal.Debug.Trace
    
    323 323
     import GHC.Internal.Unsafe.Coerce ( unsafeCoerce# ) -- just for re-export
    
    324 324
     
    

  • libraries/ghc-internal/src/GHC/Internal/Generics.hs
    ... ... @@ -732,7 +732,6 @@ module GHC.Internal.Generics (
    732 732
     -- We use some base types
    
    733 733
     import GHC.Internal.Data.Either     ( Either (..) )
    
    734 734
     import GHC.Internal.Data.Maybe      ( Maybe(..), fromMaybe )
    
    735
    -import GHC.Internal.Data.Ord        ( Down(..) )
    
    736 735
     import GHC.Internal.Bignum.Integer ( Integer, integerToInt )
    
    737 736
     import GHC.Internal.Prim        ( Addr#, Char#, Double#, Float#, Int#, Word# )
    
    738 737
     import GHC.Internal.Ptr         ( Ptr(..) )
    
    ... ... @@ -1629,9 +1628,6 @@ deriving instance Generic ((,,,,,,,,,,,,,) a b c d e f g h i j k l m n)
    1629 1628
     -- | @since base-4.16.0.0
    
    1630 1629
     deriving instance Generic ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o)
    
    1631 1630
     
    
    1632
    --- | @since base-4.12.0.0
    
    1633
    -deriving instance Generic (Down a)
    
    1634
    -
    
    1635 1631
     -- | @since base-4.15.0.0
    
    1636 1632
     deriving instance Generic SrcLoc
    
    1637 1633
     
    
    ... ... @@ -1701,9 +1697,6 @@ deriving instance Generic1 ((,,,,,,,,,,,,,) a b c d e f g h i j k l m)
    1701 1697
     -- | @since base-4.16.0.0
    
    1702 1698
     deriving instance Generic1 ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m n)
    
    1703 1699
     
    
    1704
    --- | @since base-4.12.0.0
    
    1705
    -deriving instance Generic1 Down
    
    1706
    -
    
    1707 1700
     --------------------------------------------------------------------------------
    
    1708 1701
     -- Copied from the singletons package
    
    1709 1702
     --------------------------------------------------------------------------------
    

  • libraries/ghc-internal/src/GHC/Internal/IO/Encoding/CodePage.hs
    ... ... @@ -30,7 +30,7 @@ import GHC.Internal.IO.Encoding.Types
    30 30
     import GHC.Internal.IO.Buffer
    
    31 31
     import GHC.Internal.Data.Bits
    
    32 32
     import GHC.Internal.Data.Maybe
    
    33
    -import GHC.Internal.Data.OldList (lookup)
    
    33
    +import GHC.Internal.List (lookup)
    
    34 34
     
    
    35 35
     import qualified GHC.Internal.IO.Encoding.CodePage.API as API
    
    36 36
     import GHC.Internal.IO.Encoding.CodePage.Table
    

  • libraries/ghc-internal/src/GHC/Internal/ResponseFile.hs
    ... ... @@ -28,7 +28,7 @@ import GHC.Internal.Control.Exception
    28 28
     import GHC.Internal.Data.Foldable      (Foldable(..))
    
    29 29
     import GHC.Internal.Base
    
    30 30
     import GHC.Internal.Unicode        (isSpace)
    
    31
    -import GHC.Internal.Data.List          (filter, unlines, concat, reverse)
    
    31
    +import GHC.Internal.Data.OldList       (filter, unlines, concat, reverse)
    
    32 32
     import GHC.Internal.Text.Show          (show)
    
    33 33
     import GHC.Internal.System.Environment (getArgs)
    
    34 34
     import GHC.Internal.System.Exit        (exitFailure)
    

  • libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
    ... ... @@ -36,7 +36,7 @@ import GHC.Internal.Num
    36 36
     import GHC.Internal.Data.Bits
    
    37 37
     import GHC.Internal.Data.Functor
    
    38 38
     import GHC.Internal.Data.Maybe (catMaybes)
    
    39
    -import GHC.Internal.Data.List
    
    39
    +import GHC.Internal.List
    
    40 40
     import GHC.Internal.Data.Tuple
    
    41 41
     import GHC.Internal.Foreign.Ptr
    
    42 42
     import GHC.Internal.Foreign.Storable
    

  • libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
    ... ... @@ -40,14 +40,14 @@ module GHC.Internal.System.Environment.Blank
    40 40
       ) where
    
    41 41
     
    
    42 42
     import GHC.Internal.Data.Functor
    
    43
    -import GHC.Internal.Data.List (elem, null, takeWhile)
    
    43
    +import GHC.Internal.List (elem, null, takeWhile)
    
    44 44
     import GHC.Internal.Foreign.C.String
    
    45 45
     import GHC.Internal.Base
    
    46 46
     #if defined(mingw32_HOST_OS)
    
    47 47
     import GHC.Internal.Foreign.Ptr
    
    48 48
     import GHC.Internal.Windows
    
    49 49
     import GHC.Internal.Control.Monad
    
    50
    -import GHC.Internal.Data.List (lookup)
    
    50
    +import GHC.Internal.List (lookup)
    
    51 51
     #else
    
    52 52
     import GHC.Internal.Foreign.C.Error
    
    53 53
     import GHC.Internal.Foreign.C.Types
    

  • libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
    ... ... @@ -53,7 +53,7 @@ import GHC.Internal.System.IO.Error (isDoesNotExistError)
    53 53
     import GHC.Internal.System.Posix.Internals
    
    54 54
     #elif defined(linux_HOST_OS) || defined(gnu_HOST_OS)
    
    55 55
     import GHC.Internal.Data.Functor
    
    56
    -import GHC.Internal.Data.List (isSuffixOf)
    
    56
    +import GHC.Internal.Data.OldList (isSuffixOf)
    
    57 57
     import GHC.Internal.Foreign.C.Types
    
    58 58
     import GHC.Internal.Foreign.C.Error
    
    59 59
     import GHC.Internal.Foreign.C.String
    
    ... ... @@ -85,7 +85,7 @@ import GHC.Internal.System.Posix.Internals
    85 85
     import GHC.Internal.Control.Exception
    
    86 86
     import GHC.Internal.Control.Monad.Fail
    
    87 87
     import GHC.Internal.Data.Functor
    
    88
    -import GHC.Internal.Data.List (isPrefixOf, drop)
    
    88
    +import GHC.Internal.Data.OldList (isPrefixOf, drop)
    
    89 89
     import GHC.Internal.Word
    
    90 90
     import GHC.Internal.Foreign.C.String
    
    91 91
     import GHC.Internal.Foreign.Marshal.Array
    

  • libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
    ... ... @@ -70,7 +70,7 @@ import GHC.Internal.Foreign.Storable
    70 70
     import qualified GHC.Internal.Foreign.C.String.Encoding as GHC
    
    71 71
     #else
    
    72 72
     import GHC.Internal.Int
    
    73
    -import GHC.Internal.Data.OldList (elem)
    
    73
    +import GHC.Internal.List (elem)
    
    74 74
     #endif
    
    75 75
     
    
    76 76
     -- ---------------------------------------------------------------------------