Teo Camarasu pushed to branch wip/T26834 at Glasgow Haskell Compiler / GHC
Commits:
-
ffdda2af
by Teo Camarasu at 2026-01-26T22:06:19+00:00
-
2a1f0bdc
by Teo Camarasu at 2026-01-26T22:22:43+00:00
17 changed files:
- libraries/base/src/Data/Ix.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/Zip.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Data.hs
- − libraries/ghc-internal/src/GHC/Internal/Data/Ix.hs
- libraries/ghc-internal/src/GHC/Internal/Data/List/NonEmpty.hs
- libraries/ghc-internal/src/GHC/Internal/Data/String.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Version.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc
- libraries/ghc-internal/src/GHC/Internal/ExecutionStack/Internal.hsc
- libraries/ghc-internal/src/GHC/Internal/IO/Encoding/CodePage.hs
- libraries/ghc-internal/src/GHC/Internal/ResponseFile.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
- libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
- libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
Changes:
| 1 | -{-# LANGUAGE Safe #-}
|
|
| 1 | +{-# LANGUAGE Trustworthy #-}
|
|
| 2 | 2 | |
| 3 | 3 | -- |
|
| 4 | 4 | --
|
| ... | ... | @@ -42,4 +42,4 @@ module Data.Ix |
| 42 | 42 | -- <https://www.haskell.org/onlinereport/haskell2010/haskellch19.html>.
|
| 43 | 43 | ) where
|
| 44 | 44 | |
| 45 | -import GHC.Internal.Data.Ix |
|
| 45 | +import GHC.Internal.Ix |
| ... | ... | @@ -153,7 +153,6 @@ Library |
| 153 | 153 | GHC.Internal.Data.Functor.Identity
|
| 154 | 154 | GHC.Internal.Data.Functor.Utils
|
| 155 | 155 | GHC.Internal.Data.IORef
|
| 156 | - GHC.Internal.Data.Ix
|
|
| 157 | 156 | GHC.Internal.Data.List
|
| 158 | 157 | GHC.Internal.Data.List.NonEmpty
|
| 159 | 158 | GHC.Internal.Data.Maybe
|
| ... | ... | @@ -28,7 +28,7 @@ import GHC.Internal.Data.Proxy |
| 28 | 28 | --import qualified Data.List.NonEmpty as NE
|
| 29 | 29 | import GHC.Internal.Generics
|
| 30 | 30 | import qualified GHC.Internal.Data.List.NonEmpty as NE
|
| 31 | -import qualified GHC.Internal.Data.List as List
|
|
| 31 | +import qualified GHC.Internal.List as List
|
|
| 32 | 32 | import GHC.Internal.Data.Maybe
|
| 33 | 33 | import GHC.Internal.Data.Tuple
|
| 34 | 34 | --import Prelude
|
| ... | ... | @@ -117,7 +117,7 @@ import GHC.Internal.Data.Maybe |
| 117 | 117 | import GHC.Internal.Data.Monoid
|
| 118 | 118 | import GHC.Internal.Data.NonEmpty ( NonEmpty(..) )
|
| 119 | 119 | import GHC.Internal.Data.Ord
|
| 120 | -import GHC.Internal.Data.List (findIndex)
|
|
| 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(..))
|
| 1 | -{-# LANGUAGE Trustworthy #-}
|
|
| 2 | - |
|
| 3 | ------------------------------------------------------------------------------
|
|
| 4 | --- |
|
|
| 5 | --- Module : GHC.Internal.Data.Ix
|
|
| 6 | --- Copyright : (c) The University of Glasgow 2001
|
|
| 7 | --- License : BSD-style (see the file libraries/base/LICENSE)
|
|
| 8 | ---
|
|
| 9 | --- Maintainer : libraries@haskell.org
|
|
| 10 | --- Stability : stable
|
|
| 11 | --- Portability : portable
|
|
| 12 | ---
|
|
| 13 | --- The 'Ix' class is used to map a contiguous subrange of values in
|
|
| 14 | --- type onto integers. It is used primarily for array indexing
|
|
| 15 | --- (see the array package). 'Ix' uses row-major order.
|
|
| 16 | ---
|
|
| 17 | ------------------------------------------------------------------------------
|
|
| 18 | - |
|
| 19 | -module GHC.Internal.Data.Ix
|
|
| 20 | - (
|
|
| 21 | - -- * The 'Ix' class
|
|
| 22 | - Ix
|
|
| 23 | - ( range
|
|
| 24 | - , index
|
|
| 25 | - , inRange
|
|
| 26 | - , rangeSize
|
|
| 27 | - )
|
|
| 28 | - -- Ix instances:
|
|
| 29 | - --
|
|
| 30 | - -- Ix Char
|
|
| 31 | - -- Ix Int
|
|
| 32 | - -- Ix Integer
|
|
| 33 | - -- Ix Bool
|
|
| 34 | - -- Ix Ordering
|
|
| 35 | - -- Ix ()
|
|
| 36 | - -- (Ix a, Ix b) => Ix (a, b)
|
|
| 37 | - -- ...
|
|
| 38 | - |
|
| 39 | - -- * Deriving Instances of 'Ix'
|
|
| 40 | - -- | Derived instance declarations for the class 'Ix' are only possible
|
|
| 41 | - -- for enumerations (i.e. datatypes having only nullary constructors)
|
|
| 42 | - -- and single-constructor datatypes, including arbitrarily large tuples,
|
|
| 43 | - -- whose constituent types are instances of 'Ix'.
|
|
| 44 | - --
|
|
| 45 | - -- * For an enumeration, the nullary constructors are assumed to be
|
|
| 46 | - -- numbered left-to-right with the indices being 0 to n-1 inclusive. This
|
|
| 47 | - -- is the same numbering defined by the 'Enum' class. For example, given
|
|
| 48 | - -- the datatype:
|
|
| 49 | - --
|
|
| 50 | - -- > data Colour = Red | Orange | Yellow | Green | Blue | Indigo | Violet
|
|
| 51 | - --
|
|
| 52 | - -- we would have:
|
|
| 53 | - --
|
|
| 54 | - -- > range (Yellow,Blue) == [Yellow,Green,Blue]
|
|
| 55 | - -- > index (Yellow,Blue) Green == 1
|
|
| 56 | - -- > inRange (Yellow,Blue) Red == False
|
|
| 57 | - --
|
|
| 58 | - -- * For single-constructor datatypes, the derived instance declarations
|
|
| 59 | - -- are as shown for tuples in chapter 19, section 2 of the Haskell 2010 report:
|
|
| 60 | - -- <https://www.haskell.org/onlinereport/haskell2010/haskellch19.html>.
|
|
| 61 | - |
|
| 62 | - ) where
|
|
| 63 | - |
|
| 64 | -import GHC.Internal.Ix |
| ... | ... | @@ -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.
|
| ... | ... | @@ -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.
|
| ... | ... | @@ -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(..) )
|
| ... | ... | @@ -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
|
| ... | ... | @@ -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)
|
| ... | ... | @@ -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
|
| ... | ... | @@ -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)
|
| ... | ... | @@ -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
|
| ... | ... | @@ -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
|
| ... | ... | @@ -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.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
|
| ... | ... | @@ -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 | -- ---------------------------------------------------------------------------
|
| ... | ... | @@ -80,7 +80,7 @@ module GHC.Internal.Windows ( |
| 80 | 80 | |
| 81 | 81 | import GHC.Internal.Data.Bits (finiteBitSize, shiftL, shiftR, (.|.), (.&.))
|
| 82 | 82 | import GHC.Internal.Unicode (isSpace)
|
| 83 | -import GHC.Internal.Data.OldList
|
|
| 83 | +import GHC.Internal.List
|
|
| 84 | 84 | import GHC.Internal.Data.Maybe
|
| 85 | 85 | import GHC.Internal.Word
|
| 86 | 86 | import GHC.Internal.Int
|