Teo Camarasu pushed to branch wip/T26834 at Glasgow Haskell Compiler / GHC
Commits:
-
fabb5297
by Teo Camarasu at 2026-01-27T09:28:31+00:00
-
87d4f2db
by Teo Camarasu at 2026-01-27T09:28:31+00:00
16 changed files:
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
- 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/Functor/Identity.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:
| ... | ... | @@ -40,6 +40,7 @@ import GHC.Internal.Generics |
| 40 | 40 | import GHC.Internal.List ( head, drop )
|
| 41 | 41 | import GHC.Internal.Control.Monad.ST.Imp
|
| 42 | 42 | import GHC.Internal.System.IO
|
| 43 | +import GHC.Internal.Data.Functor.Identity (Identity(..))
|
|
| 43 | 44 | |
| 44 | 45 | -- | Monads having fixed points with a \'knot-tying\' semantics.
|
| 45 | 46 | -- Instances of 'MonadFix' should satisfy the following laws:
|
| ... | ... | @@ -171,3 +172,8 @@ instance (MonadFix f, MonadFix g) => MonadFix (f :*: g) where |
| 171 | 172 | -- | @since base-4.12.0.0
|
| 172 | 173 | instance MonadFix Down where
|
| 173 | 174 | mfix f = Down (fix (getDown . f))
|
| 175 | + |
|
| 176 | + |
|
| 177 | +-- | @since base-4.8.0.0
|
|
| 178 | +instance MonadFix Identity where
|
|
| 179 | + mfix f = Identity (fix (runIdentity . f)) |
| ... | ... | @@ -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(..))
|
| ... | ... | @@ -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)) |
| ... | ... | @@ -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.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
|
| ... | ... | @@ -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
|