[Git][ghc/ghc][wip/T26875] ghc-internal: avoid depending on GHC.Internal.Control.Monad.Fix
by Teo Camarasu (@teo) 20 Feb '26
by Teo Camarasu (@teo) 20 Feb '26
20 Feb '26
Teo Camarasu pushed to branch wip/T26875 at Glasgow Haskell Compiler / GHC
Commits:
2fc47df1 by Teo Camarasu at 2026-02-20T22:09:52+00:00
ghc-internal: avoid depending on GHC.Internal.Control.Monad.Fix
This module contains the definition of MonadFix, since we want an
instance for IO, that instance requires a lot of machinery and we want
to avoid an orphan instance, this will naturally be quite high up in the
dependency graph.
So we want to avoid other modules depending on it as far as possible.
On Windows, the IO manager depends on the RTSFlags type, which
transtively depends on MonadFix. We refactor things to avoid this
dependency, which would have caused a regression.
Resolves #26875
Metric Decrease:
T12227
- - - - -
20 changed files:
- compiler/GHC/Builtin/Names.hs
- libraries/base/src/Control/Arrow.hs
- libraries/base/src/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/ST/Lazy/Imp.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows/ManagedThreadPool.hs
- libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Monad.hs
- testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
- testsuite/tests/ghci/scripts/T10963.stderr
- testsuite/tests/ghci/scripts/T4175.stdout
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/mdo/should_fail/mdofail006.stderr
Changes:
=====================================
compiler/GHC/Builtin/Names.hs
=====================================
@@ -1489,7 +1489,9 @@ composeAName = varQual gHC_INTERNAL_DESUGAR (fsLit ">>>") composeAIdKey
firstAName = varQual gHC_INTERNAL_ARROW (fsLit "first") firstAIdKey
appAName = varQual gHC_INTERNAL_ARROW (fsLit "app") appAIdKey
choiceAName = varQual gHC_INTERNAL_ARROW (fsLit "|||") choiceAIdKey
-loopAName = varQual gHC_INTERNAL_ARROW (fsLit "loop") loopAIdKey
+-- This is defined in Monad.Fix to flatten the module hierarchy of `ghc-internal`
+-- It is the only thing from Control.Arrow that requires MonadFix
+loopAName = varQual gHC_INTERNAL_MONAD_FIX (fsLit "loop") loopAIdKey
-- Monad comprehensions
guardMName, mzipName :: Name
=====================================
libraries/base/src/Control/Arrow.hs
=====================================
@@ -50,3 +50,4 @@ module Control.Arrow
) where
import GHC.Internal.Control.Arrow
+import GHC.Internal.Control.Monad.Fix (ArrowLoop(..))
=====================================
libraries/base/src/System/IO.hs
=====================================
@@ -185,6 +185,7 @@ module System.IO
) where
import GHC.Internal.System.IO
+import GHC.Internal.Control.Monad.Fix (fixIO)
-- $locking
-- Implementations should enforce as far as possible, at least locally to the
=====================================
libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs
=====================================
@@ -45,13 +45,10 @@ module GHC.Internal.Control.Arrow (
ArrowChoice(..),
-- * Arrow application
ArrowApply(..), ArrowMonad(..), leftApp,
- -- * Feedback
- ArrowLoop(..)
) where
-import GHC.Internal.Data.Tuple ( fst, snd, uncurry )
+import GHC.Internal.Data.Tuple ( uncurry )
import GHC.Internal.Data.Either
-import GHC.Internal.Control.Monad.Fix
import GHC.Internal.Control.Category
import GHC.Internal.Base hiding ( (.), id )
import GHC.Internal.Generics (Generic, Generic1)
@@ -419,55 +416,3 @@ leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d)
leftApp f = arr ((\b -> (arr (\() -> b) >>> f >>> arr Left, ())) |||
(\d -> (arr (\() -> d) >>> arr Right, ()))) >>> app
--- | The 'loop' operator expresses computations in which an output value
--- is fed back as input, although the computation occurs only once.
--- It underlies the @rec@ value recursion construct in arrow notation.
--- 'loop' should satisfy the following laws:
---
--- [/extension/]
--- @'loop' ('arr' f) = 'arr' (\\ b -> 'fst' ('fix' (\\ (c,d) -> f (b,d))))@
---
--- [/left tightening/]
--- @'loop' ('first' h >>> f) = h >>> 'loop' f@
---
--- [/right tightening/]
--- @'loop' (f >>> 'first' h) = 'loop' f >>> h@
---
--- [/sliding/]
--- @'loop' (f >>> 'arr' ('id' *** k)) = 'loop' ('arr' ('id' *** k) >>> f)@
---
--- [/vanishing/]
--- @'loop' ('loop' f) = 'loop' ('arr' unassoc >>> f >>> 'arr' assoc)@
---
--- [/superposing/]
--- @'second' ('loop' f) = 'loop' ('arr' assoc >>> 'second' f >>> 'arr' unassoc)@
---
--- where
---
--- > assoc ((a,b),c) = (a,(b,c))
--- > unassoc (a,(b,c)) = ((a,b),c)
---
-class Arrow a => ArrowLoop a where
- -- |
- --
- -- > ╭──────────────╮
- -- > b │ ╭───╮ │ c
- -- > >───┼─────┤ ├────┼───>
- -- > │ ┌─┤ ├─┐ │
- -- > │ d │ ╰───╯ │ │
- -- > │ └───<───┘ │
- -- > ╰──────────────╯
- loop :: a (b,d) (c,d) -> a b c
-
--- | @since base-2.01
-instance ArrowLoop (->) where
- loop f b = let (c,d) = f (b,d) in c
-
--- | Beware that for many monads (those for which the '>>=' operation
--- is strict) this instance will /not/ satisfy the right-tightening law
--- required by the 'ArrowLoop' class.
---
--- @since base-2.01
-instance MonadFix m => ArrowLoop (Kleisli m) where
- loop (Kleisli f) = Kleisli (liftM fst . mfix . f')
- where f' x y = f (x, snd y)
=====================================
libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
=====================================
@@ -24,7 +24,10 @@
module GHC.Internal.Control.Monad.Fix (
MonadFix(mfix),
- fix
+ fix,
+ fixIO,
+ -- * Feedback for Arrow
+ ArrowLoop(..)
) where
import GHC.Internal.Data.Either
@@ -34,12 +37,19 @@ import GHC.Internal.Data.Monoid ( Monoid, Dual(..), Sum(..), Product(..)
, First(..), Last(..), Alt(..), Ap(..) )
import GHC.Internal.Data.NonEmpty ( NonEmpty(..) )
import GHC.Internal.Data.Ord ( Down(..) )
-import GHC.Internal.Data.Tuple ( Solo(..), snd )
-import GHC.Internal.Base ( Monad, errorWithoutStackTrace, (.) )
+import GHC.Internal.Data.Tuple ( Solo(..), fst, snd )
+import GHC.Internal.Base ( IO, Monad, errorWithoutStackTrace, (.), return, liftM )
import GHC.Internal.Generics
import GHC.Internal.List ( head, drop )
import GHC.Internal.Control.Monad.ST.Imp
-import GHC.Internal.System.IO
+import qualified GHC.Internal.Control.Monad.ST.Lazy.Imp as Lazy
+import GHC.Internal.Data.Functor.Identity (Identity(..))
+import GHC.Internal.MVar
+import GHC.Internal.IO.Unsafe
+import GHC.Internal.IO.Exception
+import GHC.Internal.TH.Monad
+import GHC.Internal.Control.Exception
+import GHC.Internal.Control.Arrow
-- | Monads having fixed points with a \'knot-tying\' semantics.
-- Instances of 'MonadFix' should satisfy the following laws:
@@ -102,6 +112,86 @@ instance MonadFix NonEmpty where
instance MonadFix IO where
mfix = fixIO
+-- ---------------------------------------------------------------------------
+-- fixIO
+
+-- | The implementation of 'Control.Monad.Fix.mfix' for 'IO'.
+--
+-- This operation may fail with:
+--
+-- * 'FixIOException' if the function passed to 'fixIO' inspects its argument.
+--
+-- ==== __Examples__
+--
+-- the IO-action is only executed once. The recursion is only on the values.
+--
+-- >>> take 3 <$> fixIO (\x -> putStr ":D" >> (:x) <$> readLn @Int)
+-- :D
+-- 2
+-- [2,2,2]
+--
+-- If we are strict in the value, just as with 'Data.Function.fix', we do not get termination:
+--
+-- >>> fixIO (\x -> putStr x >> pure ('x' : x))
+-- * hangs forever *
+--
+-- We can tie the knot of a structure within 'IO' using 'fixIO':
+--
+-- @
+-- data Node = MkNode Int (IORef Node)
+--
+-- foo :: IO ()
+-- foo = do
+-- p \<- fixIO (\p -> newIORef (MkNode 0 p))
+-- q <- output p
+-- r <- output q
+-- _ <- output r
+-- pure ()
+--
+-- output :: IORef Node -> IO (IORef Node)
+-- output ref = do
+-- MkNode x p <- readIORef ref
+-- print x
+-- pure p
+-- @
+--
+-- >>> foo
+-- 0
+-- 0
+-- 0
+fixIO :: (a -> IO a) -> IO a
+fixIO k = do
+ m <- newEmptyMVar
+ ans <- unsafeDupableInterleaveIO
+ (readMVar m `catch` \BlockedIndefinitelyOnMVar ->
+ throwIO FixIOException)
+ result <- k ans
+ putMVar m result
+ return result
+
+-- Note [Blackholing in fixIO]
+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-- We do our own explicit black holing here, because GHC's lazy
+-- blackholing isn't enough. In an infinite loop, GHC may run the IO
+-- computation a few times before it notices the loop, which is wrong.
+--
+-- NOTE2: the explicit black-holing with an IORef ran into trouble
+-- with multiple threads (see #5421), so now we use an MVar. We used
+-- to use takeMVar with unsafeInterleaveIO. This, however, uses noDuplicate#,
+-- which is not particularly cheap. Better to use readMVar, which can be
+-- performed in multiple threads safely, and to use unsafeDupableInterleaveIO
+-- to avoid the noDuplicate cost.
+--
+-- What we'd ideally want is probably an IVar, but we don't quite have those.
+-- STM TVars look like an option at first, but I don't think they are:
+-- we'd need to be able to write to the variable in an IO context, which can
+-- only be done using 'atomically', and 'atomically' is not allowed within
+-- unsafePerformIO. We can't know if someone will try to use the result
+-- of fixIO with unsafePerformIO!
+--
+-- See also System.IO.Unsafe.unsafeFixIO.
+--
+
-- | @since base-2.01
instance MonadFix ((->) r) where
mfix f = \ r -> let a = f a r in a
@@ -116,6 +206,10 @@ instance MonadFix (Either e) where
instance MonadFix (ST s) where
mfix = fixST
+-- | @since base-2.01
+instance MonadFix (Lazy.ST s) where
+ mfix = Lazy.fixST
+
-- Instances of Data.Monoid wrappers
-- | @since base-4.8.0.0
@@ -171,3 +265,77 @@ instance (MonadFix f, MonadFix g) => MonadFix (f :*: g) where
-- | @since base-4.12.0.0
instance MonadFix Down where
mfix f = Down (fix (getDown . f))
+
+
+-- | @since base-4.8.0.0
+instance MonadFix Identity where
+ mfix f = Identity (fix (runIdentity . f))
+
+-- | If the function passed to 'mfix' inspects its argument,
+-- the resulting action will throw a 'FixIOException'.
+--
+-- @since 2.17.0.0
+instance MonadFix Q where
+ -- We use the same blackholing approach as in fixIO.
+ -- See Note [Blackholing in fixIO].
+ mfix k = do
+ m <- runIO newEmptyMVar
+ ans <- runIO (unsafeDupableInterleaveIO
+ (readMVar m `catch` \BlockedIndefinitelyOnMVar ->
+ throwIO FixIOException))
+ result <- k ans
+ runIO (putMVar m result)
+ return result
+
+-- | The 'loop' operator expresses computations in which an output value
+-- is fed back as input, although the computation occurs only once.
+-- It underlies the @rec@ value recursion construct in arrow notation.
+-- 'loop' should satisfy the following laws:
+--
+-- [/extension/]
+-- @'loop' ('arr' f) = 'arr' (\\ b -> 'fst' ('fix' (\\ (c,d) -> f (b,d))))@
+--
+-- [/left tightening/]
+-- @'loop' ('first' h >>> f) = h >>> 'loop' f@
+--
+-- [/right tightening/]
+-- @'loop' (f >>> 'first' h) = 'loop' f >>> h@
+--
+-- [/sliding/]
+-- @'loop' (f >>> 'arr' ('id' *** k)) = 'loop' ('arr' ('id' *** k) >>> f)@
+--
+-- [/vanishing/]
+-- @'loop' ('loop' f) = 'loop' ('arr' unassoc >>> f >>> 'arr' assoc)@
+--
+-- [/superposing/]
+-- @'second' ('loop' f) = 'loop' ('arr' assoc >>> 'second' f >>> 'arr' unassoc)@
+--
+-- where
+--
+-- > assoc ((a,b),c) = (a,(b,c))
+-- > unassoc (a,(b,c)) = ((a,b),c)
+--
+class Arrow a => ArrowLoop a where
+ -- |
+ --
+ -- > ╭──────────────╮
+ -- > b │ ╭───╮ │ c
+ -- > >───┼─────┤ ├────┼───>
+ -- > │ ┌─┤ ├─┐ │
+ -- > │ d │ ╰───╯ │ │
+ -- > │ └───<───┘ │
+ -- > ╰──────────────╯
+ loop :: a (b,d) (c,d) -> a b c
+
+-- | @since base-2.01
+instance ArrowLoop (->) where
+ loop f b = let (c,d) = f (b,d) in c
+
+-- | Beware that for many monads (those for which the '>>=' operation
+-- is strict) this instance will /not/ satisfy the right-tightening law
+-- required by the 'ArrowLoop' class.
+--
+-- @since base-2.01
+instance MonadFix m => ArrowLoop (Kleisli m) where
+ loop (Kleisli f) = Kleisli (liftM fst . mfix . f')
+ where f' x y = f (x, snd y)
=====================================
libraries/ghc-internal/src/GHC/Internal/Control/Monad/ST/Lazy/Imp.hs
=====================================
@@ -37,7 +37,6 @@ module GHC.Internal.Control.Monad.ST.Lazy.Imp (
unsafeIOToST
) where
-import GHC.Internal.Control.Monad.Fix
import GHC.Internal.Data.Tuple
import qualified GHC.Internal.Control.Monad.ST.Imp as ST
@@ -210,10 +209,6 @@ fixST m = ST (\ s ->
-- itself is demanded directly in the `let` body. See also
-- Note [Lazy ST: not producing lazy pairs].
--- | @since base-2.01
-instance MonadFix (ST s) where
- mfix = fixST
-
-- | @since base-4.23.0.0
instance Semigroup a => Semigroup (ST s a) where
(<>) = liftA2 (<>)
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs
=====================================
@@ -33,7 +33,6 @@ module GHC.Internal.Data.Functor.Identity (
Identity(..),
) where
-import GHC.Internal.Control.Monad.Fix
import GHC.Internal.Data.Bits (Bits, FiniteBits)
import GHC.Internal.Data.Coerce
import GHC.Internal.Data.Foldable
@@ -143,7 +142,3 @@ instance Applicative Identity where
-- | @since base-4.8.0.0
instance Monad Identity where
m >>= k = k (runIdentity m)
-
--- | @since base-4.8.0.0
-instance MonadFix Identity where
- mfix f = Identity (fix (runIdentity . f))
=====================================
libraries/ghc-internal/src/GHC/Internal/Event/Windows/ManagedThreadPool.hs
=====================================
@@ -35,7 +35,7 @@ import GHC.Internal.Real (fromIntegral)
import qualified GHC.Internal.Event.Array as A
import GHC.Internal.IO.Handle.Internals (debugIO)
import GHC.Internal.Conc.Sync (ThreadId(..))
-import GHC.Internal.RTS.Flags
+import GHC.Internal.RTS.Flags.Test
------------------------------------------------------------------------
-- Thread spool manager
@@ -60,7 +60,7 @@ startThreadPool job = do
let thrMinThreads = 2
let thrCurThreads = 0
let thrCallBack = job
- thrMaxThreads <- (fromIntegral . numIoWorkerThreads) `fmap` getMiscFlags
+ thrMaxThreads <- getNumIoWorkerThreads
thrActiveThreads <- newMVar 0
thrMonitor <- newEmptyMVar
thrThreadIds <- undefined -- A.new thrMaxThreads
=====================================
libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc
=====================================
@@ -4,24 +4,23 @@
-- that allows to quickly test if some flag is set.
module GHC.Internal.RTS.Flags.Test
( getUserEventTracingEnabled
+ , getNumIoWorkerThreads
)
where
import GHC.Internal.Base
-
-#if !defined(javascript_HOST_ARCH)
-
import GHC.Internal.Ptr
import GHC.Internal.Foreign.C.Types
import GHC.Internal.Foreign.Marshal.Utils
import GHC.Internal.Foreign.Storable
import GHC.Internal.Data.Functor ((<$>))
+import GHC.Internal.Word (Word32)
+import GHC.Internal.Real (fromIntegral)
#include "Rts.h"
#include "rts/Flags.h"
foreign import ccall "&RtsFlags" rtsFlagsPtr :: Ptr ()
-#endif
-- | Specialized version of 'getTraceFlags' for just checking if user
-- event tracing is enabled.
@@ -34,3 +33,9 @@ getUserEventTracingEnabled = do
let ptr = (#ptr RTS_FLAGS, TraceFlags) rtsFlagsPtr
toBool <$> (#{peek TRACE_FLAGS, user} ptr :: IO CBool)
#endif
+
+-- | Specialized version of 'getMiscFlags' for just checking the number of IO worker threads
+getNumIoWorkerThreads :: IO Int
+getNumIoWorkerThreads = do
+ let ptr = (#ptr RTS_FLAGS, MiscFlags) rtsFlagsPtr
+ fromIntegral <$> (#{peek MISC_FLAGS, numIoWorkerThreads} ptr :: IO Word32)
=====================================
libraries/ghc-internal/src/GHC/Internal/System/IO.hs
=====================================
@@ -20,7 +20,6 @@ module GHC.Internal.System.IO (
-- * The IO monad
IO,
- fixIO,
-- * Files and handles
@@ -258,7 +257,6 @@ import GHC.Internal.IO.Encoding
import GHC.Internal.Text.Read
import GHC.Internal.IO.StdHandles
import GHC.Internal.Show
-import GHC.Internal.MVar
-----------------------------------------------------------------------------
-- Standard IO
@@ -602,87 +600,6 @@ hReady h = hWaitForInput h 0
hPrint :: Show a => Handle -> a -> IO ()
hPrint hdl = hPutStrLn hdl . show
-
--- ---------------------------------------------------------------------------
--- fixIO
-
--- | The implementation of 'Control.Monad.Fix.mfix' for 'IO'.
---
--- This operation may fail with:
---
--- * 'FixIOException' if the function passed to 'fixIO' inspects its argument.
---
--- ==== __Examples__
---
--- the IO-action is only executed once. The recursion is only on the values.
---
--- >>> take 3 <$> fixIO (\x -> putStr ":D" >> (:x) <$> readLn @Int)
--- :D
--- 2
--- [2,2,2]
---
--- If we are strict in the value, just as with 'Data.Function.fix', we do not get termination:
---
--- >>> fixIO (\x -> putStr x >> pure ('x' : x))
--- * hangs forever *
---
--- We can tie the knot of a structure within 'IO' using 'fixIO':
---
--- @
--- data Node = MkNode Int (IORef Node)
---
--- foo :: IO ()
--- foo = do
--- p \<- fixIO (\p -> newIORef (MkNode 0 p))
--- q <- output p
--- r <- output q
--- _ <- output r
--- pure ()
---
--- output :: IORef Node -> IO (IORef Node)
--- output ref = do
--- MkNode x p <- readIORef ref
--- print x
--- pure p
--- @
---
--- >>> foo
--- 0
--- 0
--- 0
-fixIO :: (a -> IO a) -> IO a
-fixIO k = do
- m <- newEmptyMVar
- ans <- unsafeDupableInterleaveIO
- (readMVar m `catch` \BlockedIndefinitelyOnMVar ->
- throwIO FixIOException)
- result <- k ans
- putMVar m result
- return result
-
--- Note [Blackholing in fixIO]
--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- We do our own explicit black holing here, because GHC's lazy
--- blackholing isn't enough. In an infinite loop, GHC may run the IO
--- computation a few times before it notices the loop, which is wrong.
---
--- NOTE2: the explicit black-holing with an IORef ran into trouble
--- with multiple threads (see #5421), so now we use an MVar. We used
--- to use takeMVar with unsafeInterleaveIO. This, however, uses noDuplicate#,
--- which is not particularly cheap. Better to use readMVar, which can be
--- performed in multiple threads safely, and to use unsafeDupableInterleaveIO
--- to avoid the noDuplicate cost.
---
--- What we'd ideally want is probably an IVar, but we don't quite have those.
--- STM TVars look like an option at first, but I don't think they are:
--- we'd need to be able to write to the variable in an IO context, which can
--- only be done using 'atomically', and 'atomically' is not allowed within
--- unsafePerformIO. We can't know if someone will try to use the result
--- of fixIO with unsafePerformIO!
---
--- See also System.IO.Unsafe.unsafeFixIO.
---
-
-- | The function creates a temporary file in ReadWrite mode.
-- The created file isn\'t deleted automatically, so you need to delete it manually.
--
=====================================
libraries/ghc-internal/src/GHC/Internal/TH/Monad.hs
=====================================
@@ -28,13 +28,8 @@ import Data.Data hiding (Fixity(..))
import Data.IORef
import System.IO.Unsafe ( unsafePerformIO )
import Control.Monad.IO.Class (MonadIO (..))
-import Control.Monad.Fix (MonadFix (..))
-import Control.Exception (BlockedIndefinitelyOnMVar (..), catch, throwIO)
-import Control.Exception.Base (FixIOException (..))
-import Control.Concurrent.MVar (newEmptyMVar, readMVar, putMVar)
import System.IO ( hPutStrLn, stderr )
import qualified Data.Kind as Kind (Type)
-import GHC.IO.Unsafe ( unsafeDupableInterleaveIO )
import GHC.Types (TYPE, RuntimeRep(..))
#else
import GHC.Internal.Base hiding (NonEmpty(..),Type, Module, sequence)
@@ -46,12 +41,8 @@ import GHC.Internal.Data.Foldable
import GHC.Internal.Data.Typeable
import GHC.Internal.Control.Monad.IO.Class
import GHC.Internal.Control.Monad.Fail
-import GHC.Internal.Control.Monad.Fix
-import GHC.Internal.Control.Exception
import GHC.Internal.Num
import GHC.Internal.IO.Unsafe
-import GHC.Internal.MVar
-import GHC.Internal.IO.Exception
import qualified GHC.Internal.Types as Kind (Type)
#endif
import GHC.Internal.ForeignSrcLang
@@ -258,22 +249,6 @@ instance Semigroup a => Semigroup (Q a) where
instance Monoid a => Monoid (Q a) where
mempty = pure mempty
--- | If the function passed to 'mfix' inspects its argument,
--- the resulting action will throw a 'FixIOException'.
---
--- @since 2.17.0.0
-instance MonadFix Q where
- -- We use the same blackholing approach as in fixIO.
- -- See Note [Blackholing in fixIO] in System.IO in base.
- mfix k = do
- m <- runIO newEmptyMVar
- ans <- runIO (unsafeDupableInterleaveIO
- (readMVar m `catch` \BlockedIndefinitelyOnMVar ->
- throwIO FixIOException))
- result <- k ans
- runIO (putMVar m result)
- return result
-
-----------------------------------------------------
--
=====================================
testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
=====================================
@@ -41,10 +41,10 @@ data Tuple2 a b = (,) a b
-- Defined in ‘GHC.Internal.Tuple’
instance Traversable (Tuple2 a)
-- Defined in ‘GHC.Internal.Data.Traversable’
-instance Foldable (Tuple2 a)
- -- Defined in ‘GHC.Internal.Data.Foldable’
instance Monoid a => Applicative (Tuple2 a)
-- Defined in ‘GHC.Internal.Base’
+instance Foldable (Tuple2 a)
+ -- Defined in ‘GHC.Internal.Data.Foldable’
instance Functor (Tuple2 a) -- Defined in ‘GHC.Internal.Base’
instance Monoid a => Monad (Tuple2 a)
-- Defined in ‘GHC.Internal.Base’
=====================================
testsuite/tests/ghci/scripts/T10963.stderr
=====================================
@@ -1,4 +1,3 @@
-
<interactive>:1:1: error: [GHC-39999]
• Ambiguous type variable ‘a0’ arising from a use of ‘foo’
prevents the constraint ‘(Num a0)’ from being solved.
@@ -10,3 +9,4 @@
...plus one instance involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the expression: foo
+
=====================================
testsuite/tests/ghci/scripts/T4175.stdout
=====================================
@@ -44,8 +44,8 @@ instance Traversable Maybe
-- Defined in ‘GHC.Internal.Data.Traversable’
instance MonadFail Maybe
-- Defined in ‘GHC.Internal.Control.Monad.Fail’
-instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’
+instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
instance Functor Maybe -- Defined in ‘GHC.Internal.Base’
instance Monad Maybe -- Defined in ‘GHC.Internal.Base’
instance Semigroup a => Monoid (Maybe a)
=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -11527,8 +11527,6 @@ instance GHC.Internal.Control.Arrow.ArrowApply (->) -- Defined in ‘GHC.Interna
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Arrow.ArrowApply (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance GHC.Internal.Control.Arrow.ArrowChoice (->) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Arrow.ArrowChoice (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance GHC.Internal.Control.Arrow.ArrowLoop (->) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance forall (m :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Arrow.ArrowLoop (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.MonadPlus m => GHC.Internal.Control.Arrow.ArrowPlus (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.MonadPlus m => GHC.Internal.Control.Arrow.ArrowZero (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Category.Category (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
@@ -11544,6 +11542,8 @@ instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fail.MonadFail f => GH
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.P -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.ReadP -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadPrec.ReadPrec -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadPrec’
+instance GHC.Internal.Control.Monad.Fix.ArrowLoop (->) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall (m :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Monad.Fix.ArrowLoop (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11553,6 +11553,7 @@ instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Ei
instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11560,14 +11561,14 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Maybe.Maybe -- Def
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.ST.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix Solo -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall a. GHC.Internal.Base.Monoid a => GHC.Internal.Control.Monad.Fix.MonadFix ((,) a) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.ST.Lazy.Imp’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Complex.Complex -- Defined in ‘Data.Complex’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Functor.Identity’
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.First -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
=====================================
testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
=====================================
@@ -11554,8 +11554,6 @@ instance GHC.Internal.Control.Arrow.ArrowApply (->) -- Defined in ‘GHC.Interna
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Arrow.ArrowApply (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance GHC.Internal.Control.Arrow.ArrowChoice (->) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Arrow.ArrowChoice (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance GHC.Internal.Control.Arrow.ArrowLoop (->) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance forall (m :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Arrow.ArrowLoop (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.MonadPlus m => GHC.Internal.Control.Arrow.ArrowPlus (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.MonadPlus m => GHC.Internal.Control.Arrow.ArrowZero (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Category.Category (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
@@ -11571,6 +11569,8 @@ instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fail.MonadFail f => GH
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.P -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.ReadP -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadPrec.ReadPrec -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadPrec’
+instance GHC.Internal.Control.Monad.Fix.ArrowLoop (->) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall (m :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Monad.Fix.ArrowLoop (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11580,6 +11580,7 @@ instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Ei
instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11587,14 +11588,14 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Maybe.Maybe -- Def
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.ST.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix Solo -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall a. GHC.Internal.Base.Monoid a => GHC.Internal.Control.Monad.Fix.MonadFix ((,) a) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.ST.Lazy.Imp’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Complex.Complex -- Defined in ‘Data.Complex’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Functor.Identity’
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.First -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
=====================================
testsuite/tests/interface-stability/base-exports.stdout-mingw32
=====================================
@@ -11785,8 +11785,6 @@ instance GHC.Internal.Control.Arrow.ArrowApply (->) -- Defined in ‘GHC.Interna
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Arrow.ArrowApply (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance GHC.Internal.Control.Arrow.ArrowChoice (->) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Arrow.ArrowChoice (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance GHC.Internal.Control.Arrow.ArrowLoop (->) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance forall (m :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Arrow.ArrowLoop (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.MonadPlus m => GHC.Internal.Control.Arrow.ArrowPlus (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.MonadPlus m => GHC.Internal.Control.Arrow.ArrowZero (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Category.Category (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
@@ -11802,6 +11800,8 @@ instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fail.MonadFail f => GH
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.P -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.ReadP -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadPrec.ReadPrec -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadPrec’
+instance GHC.Internal.Control.Monad.Fix.ArrowLoop (->) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall (m :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Monad.Fix.ArrowLoop (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11811,6 +11811,7 @@ instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Ei
instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11818,14 +11819,14 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Maybe.Maybe -- Def
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.ST.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix Solo -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall a. GHC.Internal.Base.Monoid a => GHC.Internal.Control.Monad.Fix.MonadFix ((,) a) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.ST.Lazy.Imp’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Complex.Complex -- Defined in ‘Data.Complex’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Functor.Identity’
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.First -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
=====================================
testsuite/tests/interface-stability/base-exports.stdout-ws-32
=====================================
@@ -11527,8 +11527,6 @@ instance GHC.Internal.Control.Arrow.ArrowApply (->) -- Defined in ‘GHC.Interna
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Arrow.ArrowApply (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance GHC.Internal.Control.Arrow.ArrowChoice (->) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Arrow.ArrowChoice (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance GHC.Internal.Control.Arrow.ArrowLoop (->) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance forall (m :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Arrow.ArrowLoop (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.MonadPlus m => GHC.Internal.Control.Arrow.ArrowPlus (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.MonadPlus m => GHC.Internal.Control.Arrow.ArrowZero (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Category.Category (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
@@ -11544,6 +11542,8 @@ instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fail.MonadFail f => GH
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.P -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.ReadP -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadPrec.ReadPrec -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadPrec’
+instance GHC.Internal.Control.Monad.Fix.ArrowLoop (->) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall (m :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Monad.Fix.ArrowLoop (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11553,6 +11553,7 @@ instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Ei
instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11560,14 +11561,14 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Maybe.Maybe -- Def
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.ST.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix Solo -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall a. GHC.Internal.Base.Monoid a => GHC.Internal.Control.Monad.Fix.MonadFix ((,) a) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.ST.Lazy.Imp’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Complex.Complex -- Defined in ‘Data.Complex’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Functor.Identity’
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.First -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
=====================================
testsuite/tests/interface-stability/template-haskell-exports.stdout
=====================================
@@ -2052,7 +2052,6 @@ instance GHC.Internal.Classes.Ord GHC.Internal.TH.Syntax.Type -- Defined in ‘G
instance GHC.Internal.Classes.Ord GHC.Internal.TH.Syntax.TypeFamilyHead -- Defined in ‘GHC.Internal.TH.Syntax’
instance GHC.Internal.Classes.Ord GHC.Internal.LanguageExtensions.Extension -- Defined in ‘GHC.Internal.LanguageExtensions’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.TH.Monad’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.TH.Monad’
instance GHC.Internal.Control.Monad.IO.Class.MonadIO GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.TH.Monad’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.TH.Syntax.TyVarBndr -- Defined in ‘GHC.Internal.TH.Syntax’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.TH.Syntax.TyVarBndr -- Defined in ‘GHC.Internal.TH.Syntax’
=====================================
testsuite/tests/mdo/should_fail/mdofail006.stderr
=====================================
@@ -5,5 +5,5 @@ cyclic evaluation in fixIO
While handling thread blocked indefinitely in an MVar operation
HasCallStack backtrace:
- throwIO, called at libraries/ghc-internal/src/GHC/Internal/System/IO.hs:641:37 in ghc-internal:GHC.Internal.System.IO
+ throwIO, called at libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs:167:37 in ghc-internal:GHC.Internal.Control.Monad.Fix
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2fc47df125acba928347f2f4b415c9e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2fc47df125acba928347f2f4b415c9e…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: Add optional `SrcLoc` to `StackAnnotation` class
by Marge Bot (@marge-bot) 20 Feb '26
by Marge Bot (@marge-bot) 20 Feb '26
20 Feb '26
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
4c40df3d by fendor at 2026-02-20T10:24:48-05:00
Add optional `SrcLoc` to `StackAnnotation` class
`StackAnnotation`s give access to an optional `SrcLoc` field that
user-added stack annotations can use to provide better backtraces in both error
messages and when decoding the callstack.
We update builtin stack annotations such as `StringAnnotation` and
`ShowAnnotation` to also capture the `SrcLoc` of the current `CallStack`
to improve backtraces by default (if stack annotations are used).
This change is backwards compatible with GHC 9.14.1.
- - - - -
fd9aaa28 by Simon Hengel at 2026-02-20T10:25:33-05:00
docs: Fix grammar in explicit_namespaces.rst
- - - - -
fa38eb86 by Vo Minh Thu at 2026-02-20T14:02:37-05:00
GHCi: add a :version command.
This looks like:
ghci> :version
GHCi, version 9.11.20240322
This closes #24576.
Co-Author: Markus Läll <markus.l2ll(a)gmail.com>
- - - - -
13f4c086 by Andreas Klebinger at 2026-02-20T14:02:38-05:00
hadrian/build-cabal: Better respect and utilize -j
* We now respect -j<n> for the cabal invocation to build hadrian rather
than hardcoding -j
* We use the --semaphore flag to ensure cabal/ghc build the hadrian
executable in parallel using the -jsem mechanism.
Saves 10-15s on fresh builds for me.
Fixes #26876
- - - - -
25 changed files:
- + docs/users_guide/10.0.1-notes.rst
- docs/users_guide/exts/explicit_namespaces.rst
- docs/users_guide/ghci.rst
- ghc/GHCi/UI.hs
- hadrian/build-cabal
- libraries/ghc-experimental/CHANGELOG.md
- libraries/ghc-experimental/src/GHC/Stack/Annotation/Experimental.hs
- + libraries/ghc-experimental/tests/Makefile
- + libraries/ghc-experimental/tests/all.T
- + libraries/ghc-experimental/tests/backtraces/Makefile
- + libraries/ghc-experimental/tests/backtraces/T26806a.hs
- + libraries/ghc-experimental/tests/backtraces/T26806a.stderr
- + libraries/ghc-experimental/tests/backtraces/T26806b.hs
- + libraries/ghc-experimental/tests/backtraces/T26806b.stderr
- + libraries/ghc-experimental/tests/backtraces/T26806c.hs
- + libraries/ghc-experimental/tests/backtraces/T26806c.stderr
- + libraries/ghc-experimental/tests/backtraces/all.T
- libraries/ghc-internal/src/GHC/Internal/Stack/Annotation.hs
- libraries/ghc-internal/tests/stack-annotation/ann_frame001.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame002.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame003.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame004.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame005.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
Changes:
=====================================
docs/users_guide/10.0.1-notes.rst
=====================================
@@ -0,0 +1,36 @@
+.. _release-10-0-1:
+
+Version 10.0.1
+==============
+
+Language
+~~~~~~~~
+
+Compiler
+~~~~~~~~
+
+GHCi
+~~~~
+
+- Added the :ghci-cmd:`:version` command. This displays the current GHC version.
+
+Runtime system
+~~~~~~~~~~~~~~
+
+``base`` library
+~~~~~~~~~~~~~~~~
+
+``ghc-prim`` library
+~~~~~~~~~~~~~~~~~~~~
+
+``ghc`` library
+~~~~~~~~~~~~~~~
+
+``ghc-heap`` library
+~~~~~~~~~~~~~~~~~~~~
+
+``template-haskell`` library
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Included libraries
+~~~~~~~~~~~~~~~~~~
=====================================
docs/users_guide/exts/explicit_namespaces.rst
=====================================
@@ -86,7 +86,7 @@ However, how would one import only the data constructor? There are two options:
import Data.Proxy (data Proxy) -- imports the data constructor only
import Data.Proxy (pattern Proxy) -- imports the data constructor only
-The ``data`` keyword enables the import or export a data constructor without its
+The ``data`` keyword allows a data constructor to be imported or exported without its
parent type constructor.
The ``pattern`` keyword does the same, with only a few differences:
=====================================
docs/users_guide/ghci.rst
=====================================
@@ -3140,6 +3140,10 @@ commonly used commands.
The :ghci-cmd:`:uses` command requires :ghci-cmd:`:set +c` to be set.
+.. ghci-cmd:: :version
+
+ Display the current GHC version.
+
.. ghci-cmd:: :where
Show the current evaluation stack while stopped at a breakpoint.
=====================================
ghc/GHCi/UI.hs
=====================================
@@ -193,9 +193,11 @@ defaultGhciSettings =
fullHelpText = defFullHelpText
}
+versionString :: String
+versionString = "GHCi, version " ++ cProjectVersion
+
ghciWelcomeMsg :: String
-ghciWelcomeMsg = "GHCi, version " ++ cProjectVersion ++
- ": https://www.haskell.org/ghc/ :? for help"
+ghciWelcomeMsg = versionString ++ ": https://www.haskell.org/ghc/ :? for help"
ghciCommands :: [Command]
ghciCommands = map mkCmd [
@@ -253,6 +255,7 @@ ghciCommands = map mkCmd [
("unadd", keepGoingPaths unAddModule, completeFilename),
("undef", keepGoing undefineMacro, completeMacro),
("unset", keepGoing unsetOptions, completeSetOptions),
+ ("version", keepGoing showVersion', noCompletion),
("where", keepGoing whereCmd, noCompletion),
("instances", keepGoing' instancesCmd, completeExpression)
] ++ map mkCmdHidden [ -- hidden commands
@@ -366,6 +369,7 @@ defFullHelpText =
" :type +d <expr> show the type of <expr>, defaulting type variables\n" ++
" :unadd <module> ... remove module(s) from the current target set\n" ++
" :undef <cmd> undefine user-defined command :<cmd>\n" ++
+ " :version display the current GHC version\n" ++
" ::<cmd> run the builtin command\n" ++
" :!<command> run the shell command <command>\n" ++
" :shell <command> run shell via sh -c <command>\n" ++
@@ -3626,6 +3630,9 @@ unsetOptions str
no_flags <- mapM no_flag minus_opts
when (not (null no_flags)) $ newDynFlags False no_flags
+showVersion' :: GhciMonad m => String -> m ()
+showVersion' _ = liftIO (putStrLn versionString)
+
isMinus :: String -> Bool
isMinus ('-':_) = True
isMinus _ = False
=====================================
hadrian/build-cabal
=====================================
@@ -23,9 +23,52 @@ fi
CABVERSTR=$("$CABAL" --numeric-version)
CABVER=( ${CABVERSTR//./ } )
+THREADS="-j1"
+GC_THREADS=""
+SEMAPHORE=""
+
+echo "$@"
+
+# Try building hadrian in parallel. We check for -j<n>.
+# If threads > 1 we pass --semaphore to allow ghc to build more than one module in parallel
+# If threads > 4 we pass -qn as higher parallel gc thread counts can lead to slow downs
+# We only do any of thise for cabal >= 3.14, because I don't trust older versions to handle --semaphore right
+if [ "${CABVER[0]}" -gt 3 ] || [ "${CABVER[0]}" -eq 3 -a "${CABVER[1]}" -ge 14 ];
+then
+
+ for arg in "$@"; do
+ case "$arg" in
+ -j)
+ GC_THREADS="-qn4"
+ SEMAPHORE="--semaphore"
+ THREADS="-j"
+ ;;
+ -j[0-9]*)
+ threads="${arg#-j}"
+ if [[ "$threads" =~ ^[0-9]+$ ]] && [ "$threads" -ne 0 ]; then
+ THREADS="-j${threads}"
+ if [ $threads -ge 4 ]; then
+ GC_THREADS="-qn4"
+ fi
+ if [ $threads -gt 1 ]; then
+ SEMAPHORE="--semaphore"
+ fi
+ fi
+ ;;
+ esac
+
+ done
+
+fi
+
+if [ "$(uname -s)" = "FreeBSD" ]; then
+ # Can't rely on posix semaphore support in free bsd.
+ SEMAPHORE=""
+fi
+
if [ "${CABVER[0]}" -gt 2 -o "${CABVER[0]}" -eq 2 -a "${CABVER[1]}" -ge 2 ];
then
- "$CABAL" --project-file="$PROJ" new-build "${CABFLAGS[@]}" -j exe:hadrian
+ "$CABAL" --project-file="$PROJ" new-build "${CABFLAGS[@]}" ${THREADS} ${SEMAPHORE} --ghc-options="+RTS ${GC_THREADS} -RTS" exe:hadrian
# use new-exec instead of new-run to make sure that the build-tools (alex & happy) are in PATH
"$CABAL" --project-file="$PROJ" new-exec "${CABFLAGS[@]}" hadrian -- \
--directory "$PWD" \
=====================================
libraries/ghc-experimental/CHANGELOG.md
=====================================
@@ -5,12 +5,17 @@
- New and/or/xor SIMD primops for bitwise logical operations, such as andDoubleX4#, orWord32X4#, xorInt8X16#, etc.
These are supported by the LLVM backend and by the X86_64 NCG backend (for the latter, only for 128-wide vectors).
-## ghc-experimental-9.1401.0,
+## ghc-experimental-9.1402.0
+
+- Add optional `SrcLoc` to `StackAnnotation` class in `GHC.Stack.Annotation.Experimental`
+
+## ghc-experimental-9.1401.0
- Expose access to RTS flags via `GHC.RTS.Flags.Experimental`
- Expose access to era profiling interface via `GHC.Profiling.Eras`
- Expose access to runtime stack annotations via `GHC.Stack.Annotation.Experimental`
- Expose custom allocation limit handler via `System.Mem.Experimental`
+- Expose access to Stack Annotations via `GHC.Stack.Annotation.Experimental`
- Expose module Prelude.Experimental, which reexports some modules from ghc-experimental for convenience, like Prelude does for base.
## ghc-experimental-9.1201.0
=====================================
libraries/ghc-experimental/src/GHC/Stack/Annotation/Experimental.hs
=====================================
@@ -82,9 +82,6 @@ import GHC.Internal.Stack.Annotation
-- the pure variations can behave in ways that are hard to predict.
--
-- See Note [Stack annotations in pure code] for more details.
---
--- At last, stack annotations are tricky to use with 'error'.
--- See Note [Pushing annotation frames on 'error'] for why this is the case.
-- Note [Stack annotations in pure code]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -96,57 +93,50 @@ import GHC.Internal.Stack.Annotation
-- For example:
--
-- @
--- annotateStackShow (5 @Int) (fib 20 + throw (ErrorCall "Oh no!"))
+-- annotateStackShow (5 @Int) (fib 20 + error "Oh no!")
-- @
--
--- Without forcing the result of @(fib 20 + throw (ErrorCall "Oh no!"))@, the computation
+-- Without forcing the result of @(fib 20 + error "Oh no!")@, the computation
-- will simply return a thunk, and the stack annotation would be popped off the stack.
-- Once the thunk is evaluated, the exception is raised, but no stack annotation will be found!
--- If we force the result of @(fib 20 + throw (ErrorCall "Oh no!"))@, then the stack
+-- If we force the result of @(fib 20 + error "Oh no!")@, then the stack
-- annotations remain on the stack, and are displayed in the stack trace.
--
-- Naturally, this only holds if no imprecise exceptions are thrown during evaluation of any
-- nested value, for example in 'annotateStackShow 5 (Just $ throw (ErrorCall "Oh no!"))', the
-- stack trace will not include the value @5@.
--
--- See how we preferred @throw (ErrorCall ...)@ over @error@?
--- See Note [Pushing annotation frames on 'error'] for why we do this.
-
--- Note [Pushing annotation frames on 'error']
--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- Examples so far have not been using 'error' at all.
--- The reason is that 'error' is extraordinarily difficult to use correctly with stack annotation frames.
--- See Note [Capturing the backtrace in throw] for a detailed discussion of how 'throw'
--- manages to capture 'Backtraces'.
---
--- Long story short, 'error' does not do the same thing as 'throw' and is subtly different
--- in terms of evaluation, cause it to bypass the stack annotation frames, especially in
--- pure code.
---
--- However, even in 'IO' code, it is difficult to use 'error' and obtain stack annotation frames
--- close to the call site due to the same issue of laziness and backtrace collection.
---
--- This means, right now, if you want to reliably capture stack frame annotations,
--- in both pure and impure code, prefer 'throw' and 'throwIO' variants over 'error'.
-- ----------------------------------------------------------------------------
-- Annotations
-- ----------------------------------------------------------------------------
+
+-- | A 'String' only annotation with an optional source location.
data StringAnnotation where
- StringAnnotation :: String -> StringAnnotation
+ StringAnnotation :: !(Maybe SrcLoc) -> String -> StringAnnotation
instance StackAnnotation StringAnnotation where
- displayStackAnnotation (StringAnnotation str) = str
+ displayStackAnnotationShort (StringAnnotation _srcLoc str) =
+ str
+
+ stackAnnotationSourceLocation (StringAnnotation srcLoc _str) =
+ srcLoc
-- | Use the 'Show' instance of a type to display as the 'StackAnnotation'.
data ShowAnnotation where
- ShowAnnotation :: forall a . Show a => a -> ShowAnnotation
+ ShowAnnotation :: forall a . Show a => !(Maybe SrcLoc) -> a -> ShowAnnotation
instance StackAnnotation ShowAnnotation where
- displayStackAnnotation (ShowAnnotation showAnno) = show showAnno
+ displayStackAnnotationShort (ShowAnnotation _srcLoc showAnno) =
+ show showAnno
+
+ stackAnnotationSourceLocation (ShowAnnotation srcLoc _showAnno) =
+ srcLoc
-- | A 'CallStack' stack annotation.
+--
+-- Captures the whole 'CallStack'.
newtype CallStackAnnotation = CallStackAnnotation CallStack
instance Show CallStackAnnotation where
@@ -154,9 +144,23 @@ instance Show CallStackAnnotation where
-- | Displays the first entry of the 'CallStack'
instance StackAnnotation CallStackAnnotation where
- displayStackAnnotation (CallStackAnnotation cs) = case getCallStack cs of
+ stackAnnotationSourceLocation (CallStackAnnotation cs) =
+ callStackHeadSrcLoc cs
+
+ displayStackAnnotationShort (CallStackAnnotation cs) =
+ callStackHeadFunctionName cs
+
+callStackHeadSrcLoc :: CallStack -> Maybe SrcLoc
+callStackHeadSrcLoc cs =
+ case getCallStack cs of
+ [] -> Nothing
+ (_, srcLoc):_ -> Just srcLoc
+
+callStackHeadFunctionName :: CallStack -> String
+callStackHeadFunctionName cs =
+ case getCallStack cs of
[] -> "<unknown source location>"
- ((fnName,srcLoc):_) -> fnName ++ ", called at " ++ prettySrcLoc srcLoc
+ (fnName, _):_ -> fnName
-- ----------------------------------------------------------------------------
-- Annotate the CallStack with custom data
@@ -172,7 +176,7 @@ instance StackAnnotation CallStackAnnotation where
--
-- WARNING: forces the evaluation of @b@ to WHNF.
{-# NOINLINE annotateStack #-}
-annotateStack :: forall a b. (Typeable a, StackAnnotation a) => a -> b -> b
+annotateStack :: forall a b. (HasCallStack, Typeable a, StackAnnotation a) => a -> b -> b
annotateStack ann b = unsafePerformIO $
annotateStackIO ann (evaluate b)
@@ -196,9 +200,9 @@ annotateCallStack b = unsafePerformIO $ withFrozenCallStack $
-- information to stack traces.
--
-- WARNING: forces the evaluation of @b@ to WHNF.
-annotateStackString :: forall b . String -> b -> b
+annotateStackString :: forall b . HasCallStack => String -> b -> b
annotateStackString ann =
- annotateStack (StringAnnotation ann)
+ annotateStack (StringAnnotation (callStackHeadSrcLoc ?callStack) ann)
-- | @'annotateStackShow' showable b@ annotates the evaluation stack of @b@
-- with the value @showable@.
@@ -207,37 +211,36 @@ annotateStackString ann =
-- information to stack traces.
--
-- WARNING: forces the evaluation of @b@ to WHNF.
-annotateStackShow :: forall a b . (Typeable a, Show a) => a -> b -> b
+annotateStackShow :: forall a b . (HasCallStack, Typeable a, Show a) => a -> b -> b
annotateStackShow ann =
- annotateStack (ShowAnnotation ann)
+ annotateStack (ShowAnnotation (callStackHeadSrcLoc ?callStack) ann)
-- | @'annotateStackIO' showable b@ annotates the evaluation stack of @b@
-- with the value @showable@.
--
-- When decoding the call stack, the annotation frames can be used to add more
-- information to stack traces.
-annotateStackIO :: forall a b . (Typeable a, StackAnnotation a) => a -> IO b -> IO b
+annotateStackIO :: forall a b . (HasCallStack, Typeable a, StackAnnotation a) => a -> IO b -> IO b
annotateStackIO ann (IO act) =
IO $ \s -> annotateStack# (SomeStackAnnotation ann) act s
-{-# NOINLINE annotateStackIO #-}
-- | @'annotateStackStringIO' msg b@ annotates the evaluation stack of @b@
-- with the value @msg@.
--
-- When decoding the call stack, the annotation frames can be used to add more
-- information to stack traces.
-annotateStackStringIO :: forall b . String -> IO b -> IO b
+annotateStackStringIO :: forall b . HasCallStack => String -> IO b -> IO b
annotateStackStringIO ann =
- annotateStackIO (StringAnnotation ann)
+ annotateStackIO (StringAnnotation (callStackHeadSrcLoc ?callStack) ann)
-- | @'annotateStackShowIO' msg b@ annotates the evaluation stack of @b@
-- with the value @msg@.
--
-- When decoding the call stack, the annotation frames can be used to add more
-- information to stack traces.
-annotateStackShowIO :: forall a b . (Show a) => a -> IO b -> IO b
+annotateStackShowIO :: forall a b . (HasCallStack, Show a) => a -> IO b -> IO b
annotateStackShowIO ann =
- annotateStackIO (ShowAnnotation ann)
+ annotateStackIO (ShowAnnotation (callStackHeadSrcLoc ?callStack) ann)
-- | @'annotateCallStackIO' b@ annotates the evaluation stack of @b@ with the
-- current 'callstack'.
=====================================
libraries/ghc-experimental/tests/Makefile
=====================================
@@ -0,0 +1,7 @@
+# This Makefile runs the tests using GHC's testsuite framework. It
+# assumes the package is part of a GHC build tree with the testsuite
+# installed in ../../../testsuite.
+
+TOP=../../../testsuite
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
=====================================
libraries/ghc-experimental/tests/all.T
=====================================
=====================================
libraries/ghc-experimental/tests/backtraces/Makefile
=====================================
@@ -0,0 +1,7 @@
+# This Makefile runs the tests using GHC's testsuite framework. It
+# assumes the package is part of a GHC build tree with the testsuite
+# installed in ../../../testsuite.
+
+TOP=../../../../testsuite
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
=====================================
libraries/ghc-experimental/tests/backtraces/T26806a.hs
=====================================
@@ -0,0 +1,14 @@
+module Main where
+
+import GHC.Stack.Annotation.Experimental
+import Control.Exception
+import Control.Exception.Backtrace
+
+main :: IO ()
+main = do
+ setBacktraceMechanismState IPEBacktrace True
+ annotateCallStackIO $ do
+ annotateStackShowIO ([1..4] :: [Int]) $ do
+ annotateStackStringIO "Lovely annotation" $ do
+ throwIO $ ErrorCall "Backtrace Test"
+
=====================================
libraries/ghc-experimental/tests/backtraces/T26806a.stderr
=====================================
@@ -0,0 +1,11 @@
+T26806a: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+Backtrace Test
+
+IPE backtrace:
+ Lovely annotation, called at T26806a.hs:12:7 in main:Main
+ [1,2,3,4], called at T26806a.hs:11:5 in main:Main
+ annotateCallStackIO, called at T26806a.hs:10:3 in main:Main
+HasCallStack backtrace:
+ throwIO, called at T26806a.hs:13:9 in main:Main
+
=====================================
libraries/ghc-experimental/tests/backtraces/T26806b.hs
=====================================
@@ -0,0 +1,18 @@
+module Main where
+
+import GHC.Stack.Annotation.Experimental
+import Control.Exception
+import Control.Exception.Backtrace
+
+main :: IO ()
+main = do
+ setBacktraceMechanismState IPEBacktrace True
+ print $ foo 500
+
+foo :: Int -> Int
+foo n =
+ annotateCallStack $
+ annotateStackShow ([1..4] :: [Int]) $
+ annotateStackString "Lovely annotation" $
+ throw $ ErrorCall $ "Backtrace Test: " ++ show (n * n * n)
+
=====================================
libraries/ghc-experimental/tests/backtraces/T26806b.stderr
=====================================
@@ -0,0 +1,10 @@
+T26806b: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+Backtrace Test: 125000000
+
+IPE backtrace:
+ Lovely annotation, called at T26806b.hs:16:7 in main:Main
+ [1,2,3,4], called at T26806b.hs:15:5 in main:Main
+ annotateCallStack, called at T26806b.hs:14:3 in main:Main
+HasCallStack backtrace:
+ throw, called at T26806b.hs:17:9 in main:Main
=====================================
libraries/ghc-experimental/tests/backtraces/T26806c.hs
=====================================
@@ -0,0 +1,18 @@
+module Main where
+
+import GHC.Stack.Annotation.Experimental
+import Control.Exception
+import Control.Exception.Backtrace
+
+main :: IO ()
+main = do
+ setBacktraceMechanismState IPEBacktrace True
+ print $ foo 500
+
+foo :: Int -> Int
+foo n =
+ annotateCallStack $
+ annotateStackShow ([1..4] :: [Int]) $
+ annotateStackString "Lovely annotation" $
+ error $ "Backtrace Test: " ++ show (n * n * n)
+
=====================================
libraries/ghc-experimental/tests/backtraces/T26806c.stderr
=====================================
@@ -0,0 +1,11 @@
+T26806c: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+Backtrace Test: 125000000
+
+IPE backtrace:
+ Lovely annotation, called at T26806c.hs:16:7 in main:Main
+ [1,2,3,4], called at T26806c.hs:15:5 in main:Main
+ annotateCallStack, called at T26806c.hs:14:3 in main:Main
+HasCallStack backtrace:
+ error, called at T26806c.hs:17:9 in main:Main
+
=====================================
libraries/ghc-experimental/tests/backtraces/all.T
=====================================
@@ -0,0 +1,5 @@
+stack_annotation_backtrace_opts = [ when(have_profiling(), extra_ways(['prof'])) , when(js_arch(), skip) , exit_code(1) ]
+
+test('T26806a', stack_annotation_backtrace_opts, compile_and_run, [''])
+test('T26806b', stack_annotation_backtrace_opts, compile_and_run, [''])
+test('T26806c', stack_annotation_backtrace_opts, compile_and_run, [''])
=====================================
libraries/ghc-internal/src/GHC/Internal/Stack/Annotation.hs
=====================================
@@ -4,6 +4,7 @@ module GHC.Internal.Stack.Annotation where
import GHC.Internal.Base
import GHC.Internal.Data.Typeable
+import GHC.Internal.Stack (SrcLoc, prettySrcLoc)
-- ----------------------------------------------------------------------------
-- StackAnnotation
@@ -13,8 +14,38 @@ import GHC.Internal.Data.Typeable
-- as the payload of 'AnnFrame' stack frames.
--
class StackAnnotation a where
+ -- | Display a human readable string for the 'StackAnnotation'.
+ --
+ -- This is supposed to be the long version of 'displayStackAnnotationShort'
+ -- and may contain a source location.
+ --
+ -- If not provided, 'displayStackAnnotation' is derived from 'stackAnnotationSourceLocation'
+ -- and 'displayStackAnnotationShort'.
displayStackAnnotation :: a -> String
+ -- | Get the 'SrcLoc' of the given 'StackAnnotation'.
+ --
+ -- This is optional, 'SrcLoc' are not strictly required for 'StackAnnotation', but
+ -- it is still heavily encouarged to provide a 'SrcLoc' for better IPE backtraces.
+ stackAnnotationSourceLocation :: a -> Maybe SrcLoc
+
+ -- | The description of the StackAnnotation without any metadata such as source locations.
+ --
+ -- Pefer implementing 'displayStackAnnotationShort' over 'displayStackAnnotation'.
+ displayStackAnnotationShort :: a -> String
+
+ {-# MINIMAL displayStackAnnotation | displayStackAnnotationShort #-}
+
+ displayStackAnnotation ann =
+ displayStackAnnotationShort ann
+ ++ case stackAnnotationSourceLocation ann of
+ Nothing -> ""
+ Just srcLoc -> ", called at " ++ prettySrcLoc srcLoc
+
+ stackAnnotationSourceLocation _ann = Nothing
+
+ displayStackAnnotationShort = displayStackAnnotation
+
-- ----------------------------------------------------------------------------
-- Annotations
-- ----------------------------------------------------------------------------
@@ -28,4 +59,11 @@ data SomeStackAnnotation where
SomeStackAnnotation :: forall a. (Typeable a, StackAnnotation a) => a -> SomeStackAnnotation
instance StackAnnotation SomeStackAnnotation where
- displayStackAnnotation (SomeStackAnnotation a) = displayStackAnnotation a
+ displayStackAnnotation (SomeStackAnnotation a) =
+ displayStackAnnotation a
+
+ stackAnnotationSourceLocation (SomeStackAnnotation a) =
+ stackAnnotationSourceLocation a
+
+ displayStackAnnotationShort (SomeStackAnnotation a) =
+ displayStackAnnotationShort a
=====================================
libraries/ghc-internal/tests/stack-annotation/ann_frame001.stdout
=====================================
@@ -1,12 +1,12 @@
Stack annotations:
-- (2,3)
+- (2,3), called at ann_frame001.hs:5:13 in main:Main
47
Stack annotations:
-- "bar"
-- "foo"
-- "tailCallEx"
+- "bar", called at ann_frame001.hs:23:9 in main:Main
+- "foo", called at ann_frame001.hs:21:11 in main:Main
+- "tailCallEx", called at ann_frame001.hs:17:18 in main:Main
Stack annotations:
-- "bar"
-- "foo"
-- "tailCallEx"
+- "bar", called at ann_frame001.hs:23:9 in main:Main
+- "foo", called at ann_frame001.hs:21:11 in main:Main
+- "tailCallEx", called at ann_frame001.hs:17:18 in main:Main
40
=====================================
libraries/ghc-internal/tests/stack-annotation/ann_frame002.stdout
=====================================
@@ -7,5 +7,5 @@ Finish some work
Some more work in bar
17711
Stack annotations:
-- bar
+- bar, called at ann_frame002.hs:23:29 in main:Main
- annotateCallStackIO, called at ann_frame002.hs:23:7 in main:Main
=====================================
libraries/ghc-internal/tests/stack-annotation/ann_frame003.stdout
=====================================
@@ -1,6 +1,6 @@
47
Stack annotations:
-- "bar"
-- "foo"
-- "tailCallEx"
+- "bar", called at ann_frame003.hs:25:9 in main:Main
+- "foo", called at ann_frame003.hs:21:11 in main:Main
+- "tailCallEx", called at ann_frame003.hs:16:18 in main:Main
40
=====================================
libraries/ghc-internal/tests/stack-annotation/ann_frame004.stdout
=====================================
@@ -13,5 +13,5 @@ Stack annotations:
- annotateCallStack, called at ann_frame004.hs:21:17 in main:Main
- annotateCallStack, called at ann_frame004.hs:21:17 in main:Main
- annotateCallStack, called at ann_frame004.hs:13:10 in main:Main
-- bar
+- bar, called at ann_frame004.hs:12:29 in main:Main
- annotateCallStackIO, called at ann_frame004.hs:12:7 in main:Main
=====================================
libraries/ghc-internal/tests/stack-annotation/ann_frame005.stdout
=====================================
@@ -2,9 +2,9 @@
Caught exception: SimpleBoom
Exception context:
- IPE backtrace:
-- throwIO SimpleBoom
-- raising action
-- catch site for throwIO SimpleBoom
+- throwIO SimpleBoom, called at ann_frame005.hs:33:5 in main:Main
+- raising action, called at ann_frame005.hs:32:3 in main:Main
+- catch site for throwIO SimpleBoom, called at ann_frame005.hs:27:5 in main:Main
- annotateCallStackIO, called at ann_frame005.hs:26:3 in main:Main
- HasCallStack backtrace:
- throwIO, called at ann_frame005.hs:34:7 in main:Main
@@ -13,9 +13,9 @@ Handler annotation not present in context
Caught exception: Prelude.undefined
Exception context:
- IPE backtrace:
-- undefined thunk
-- raising undefined action
-- catch site for undefined
+- undefined thunk, called at ann_frame005.hs:41:9 in main:Main
+- raising undefined action, called at ann_frame005.hs:38:3 in main:Main
+- catch site for undefined, called at ann_frame005.hs:27:5 in main:Main
- annotateCallStackIO, called at ann_frame005.hs:26:3 in main:Main
- HasCallStack backtrace:
- undefined, called at ann_frame005.hs:41:48 in main:Main
@@ -24,9 +24,9 @@ Handler annotation not present in context
Caught exception: error from annotateStackString
Exception context:
- IPE backtrace:
-- error thunk
-- raising error action
-- catch site for error
+- error thunk, called at ann_frame005.hs:48:9 in main:Main
+- raising error action, called at ann_frame005.hs:45:3 in main:Main
+- catch site for error, called at ann_frame005.hs:27:5 in main:Main
- annotateCallStackIO, called at ann_frame005.hs:26:3 in main:Main
- HasCallStack backtrace:
- error, called at ann_frame005.hs:48:44 in main:Main
@@ -35,8 +35,8 @@ Handler annotation not present in context
Caught exception: SimpleBoom
Exception context:
- IPE backtrace:
-- raising throwSTM action
-- catch site for throwSTM
+- raising throwSTM action, called at ann_frame005.hs:52:3 in main:Main
+- catch site for throwSTM, called at ann_frame005.hs:27:5 in main:Main
- annotateCallStackIO, called at ann_frame005.hs:26:3 in main:Main
- HasCallStack backtrace:
- throwSTM, called at ann_frame005.hs:55:9 in main:Main
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout
=====================================
@@ -6499,25 +6499,27 @@ module GHC.Stack.Annotation.Experimental where
newtype CallStackAnnotation = CallStackAnnotation GHC.Internal.Stack.Types.CallStack
type ShowAnnotation :: *
data ShowAnnotation where
- ShowAnnotation :: forall a. GHC.Internal.Show.Show a => a -> ShowAnnotation
+ ShowAnnotation :: forall a. GHC.Internal.Show.Show a => !(GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc) -> a -> ShowAnnotation
type SomeStackAnnotation :: *
data SomeStackAnnotation where
SomeStackAnnotation :: forall a. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> SomeStackAnnotation
type StackAnnotation :: * -> Constraint
class StackAnnotation a where
displayStackAnnotation :: a -> GHC.Internal.Base.String
- {-# MINIMAL displayStackAnnotation #-}
+ stackAnnotationSourceLocation :: a -> GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc
+ displayStackAnnotationShort :: a -> GHC.Internal.Base.String
+ {-# MINIMAL displayStackAnnotation | displayStackAnnotationShort #-}
type StringAnnotation :: *
data StringAnnotation where
- StringAnnotation :: GHC.Internal.Base.String -> StringAnnotation
+ StringAnnotation :: !(GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc) -> GHC.Internal.Base.String -> StringAnnotation
annotateCallStack :: forall b. GHC.Internal.Stack.Types.HasCallStack => b -> b
annotateCallStackIO :: forall a. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Types.IO a -> GHC.Internal.Types.IO a
- annotateStack :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> b -> b
- annotateStackIO :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
- annotateStackShow :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Show.Show a) => a -> b -> b
- annotateStackShowIO :: forall a b. GHC.Internal.Show.Show a => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
- annotateStackString :: forall b. GHC.Internal.Base.String -> b -> b
- annotateStackStringIO :: forall b. GHC.Internal.Base.String -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStack :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> b -> b
+ annotateStackIO :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStackShow :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Show.Show a) => a -> b -> b
+ annotateStackShowIO :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, GHC.Internal.Show.Show a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStackString :: forall b. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Base.String -> b -> b
+ annotateStackStringIO :: forall b. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Base.String -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
module GHC.Stats.Experimental where
-- Safety: Safe
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
=====================================
@@ -6502,25 +6502,27 @@ module GHC.Stack.Annotation.Experimental where
newtype CallStackAnnotation = CallStackAnnotation GHC.Internal.Stack.Types.CallStack
type ShowAnnotation :: *
data ShowAnnotation where
- ShowAnnotation :: forall a. GHC.Internal.Show.Show a => a -> ShowAnnotation
+ ShowAnnotation :: forall a. GHC.Internal.Show.Show a => !(GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc) -> a -> ShowAnnotation
type SomeStackAnnotation :: *
data SomeStackAnnotation where
SomeStackAnnotation :: forall a. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> SomeStackAnnotation
type StackAnnotation :: * -> Constraint
class StackAnnotation a where
displayStackAnnotation :: a -> GHC.Internal.Base.String
- {-# MINIMAL displayStackAnnotation #-}
+ stackAnnotationSourceLocation :: a -> GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc
+ displayStackAnnotationShort :: a -> GHC.Internal.Base.String
+ {-# MINIMAL displayStackAnnotation | displayStackAnnotationShort #-}
type StringAnnotation :: *
data StringAnnotation where
- StringAnnotation :: GHC.Internal.Base.String -> StringAnnotation
+ StringAnnotation :: !(GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc) -> GHC.Internal.Base.String -> StringAnnotation
annotateCallStack :: forall b. GHC.Internal.Stack.Types.HasCallStack => b -> b
annotateCallStackIO :: forall a. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Types.IO a -> GHC.Internal.Types.IO a
- annotateStack :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> b -> b
- annotateStackIO :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
- annotateStackShow :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Show.Show a) => a -> b -> b
- annotateStackShowIO :: forall a b. GHC.Internal.Show.Show a => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
- annotateStackString :: forall b. GHC.Internal.Base.String -> b -> b
- annotateStackStringIO :: forall b. GHC.Internal.Base.String -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStack :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> b -> b
+ annotateStackIO :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStackShow :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Show.Show a) => a -> b -> b
+ annotateStackShowIO :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, GHC.Internal.Show.Show a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStackString :: forall b. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Base.String -> b -> b
+ annotateStackStringIO :: forall b. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Base.String -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
module GHC.Stats.Experimental where
-- Safety: Safe
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c36d2bb8574640464fb31636e6a45f…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c36d2bb8574640464fb31636e6a45f…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Teo Camarasu pushed new branch wip/T26940 at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T26940
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26875] ghc-internal: avoid depending on GHC.Internal.Control.Monad.Fix
by Teo Camarasu (@teo) 20 Feb '26
by Teo Camarasu (@teo) 20 Feb '26
20 Feb '26
Teo Camarasu pushed to branch wip/T26875 at Glasgow Haskell Compiler / GHC
Commits:
c6c69769 by Teo Camarasu at 2026-02-20T18:25:00+00:00
ghc-internal: avoid depending on GHC.Internal.Control.Monad.Fix
This module contains the definition of MonadFix, since we want an
instance for IO, that instance requires a lot of machinery and we want
to avoid an orphan instance, this will naturally be quite high up in the
dependency graph.
So we want to avoid other modules depending on it as far as possible.
On Windows, the IO manager depends on the RTSFlags type, which
transtively depends on MonadFix. We refactor things to avoid this
dependency, which would have caused a regression.
Resolves #26875
- - - - -
20 changed files:
- compiler/GHC/Builtin/Names.hs
- libraries/base/src/Control/Arrow.hs
- libraries/base/src/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/ST/Lazy/Imp.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows/ManagedThreadPool.hs
- libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Monad.hs
- testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
- testsuite/tests/ghci/scripts/T10963.stderr
- testsuite/tests/ghci/scripts/T4175.stdout
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/mdo/should_fail/mdofail006.stderr
Changes:
=====================================
compiler/GHC/Builtin/Names.hs
=====================================
@@ -1489,7 +1489,9 @@ composeAName = varQual gHC_INTERNAL_DESUGAR (fsLit ">>>") composeAIdKey
firstAName = varQual gHC_INTERNAL_ARROW (fsLit "first") firstAIdKey
appAName = varQual gHC_INTERNAL_ARROW (fsLit "app") appAIdKey
choiceAName = varQual gHC_INTERNAL_ARROW (fsLit "|||") choiceAIdKey
-loopAName = varQual gHC_INTERNAL_ARROW (fsLit "loop") loopAIdKey
+-- This is defined in Monad.Fix to flatten the module hierarchy of `ghc-internal`
+-- It is the only thing from Control.Arrow that requires MonadFix
+loopAName = varQual gHC_INTERNAL_MONAD_FIX (fsLit "loop") loopAIdKey
-- Monad comprehensions
guardMName, mzipName :: Name
=====================================
libraries/base/src/Control/Arrow.hs
=====================================
@@ -50,3 +50,4 @@ module Control.Arrow
) where
import GHC.Internal.Control.Arrow
+import GHC.Internal.Control.Monad.Fix (ArrowLoop(..))
=====================================
libraries/base/src/System/IO.hs
=====================================
@@ -185,6 +185,7 @@ module System.IO
) where
import GHC.Internal.System.IO
+import GHC.Internal.Control.Monad.Fix (fixIO)
-- $locking
-- Implementations should enforce as far as possible, at least locally to the
=====================================
libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs
=====================================
@@ -45,13 +45,10 @@ module GHC.Internal.Control.Arrow (
ArrowChoice(..),
-- * Arrow application
ArrowApply(..), ArrowMonad(..), leftApp,
- -- * Feedback
- ArrowLoop(..)
) where
-import GHC.Internal.Data.Tuple ( fst, snd, uncurry )
+import GHC.Internal.Data.Tuple ( uncurry )
import GHC.Internal.Data.Either
-import GHC.Internal.Control.Monad.Fix
import GHC.Internal.Control.Category
import GHC.Internal.Base hiding ( (.), id )
import GHC.Internal.Generics (Generic, Generic1)
@@ -419,55 +416,3 @@ leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d)
leftApp f = arr ((\b -> (arr (\() -> b) >>> f >>> arr Left, ())) |||
(\d -> (arr (\() -> d) >>> arr Right, ()))) >>> app
--- | The 'loop' operator expresses computations in which an output value
--- is fed back as input, although the computation occurs only once.
--- It underlies the @rec@ value recursion construct in arrow notation.
--- 'loop' should satisfy the following laws:
---
--- [/extension/]
--- @'loop' ('arr' f) = 'arr' (\\ b -> 'fst' ('fix' (\\ (c,d) -> f (b,d))))@
---
--- [/left tightening/]
--- @'loop' ('first' h >>> f) = h >>> 'loop' f@
---
--- [/right tightening/]
--- @'loop' (f >>> 'first' h) = 'loop' f >>> h@
---
--- [/sliding/]
--- @'loop' (f >>> 'arr' ('id' *** k)) = 'loop' ('arr' ('id' *** k) >>> f)@
---
--- [/vanishing/]
--- @'loop' ('loop' f) = 'loop' ('arr' unassoc >>> f >>> 'arr' assoc)@
---
--- [/superposing/]
--- @'second' ('loop' f) = 'loop' ('arr' assoc >>> 'second' f >>> 'arr' unassoc)@
---
--- where
---
--- > assoc ((a,b),c) = (a,(b,c))
--- > unassoc (a,(b,c)) = ((a,b),c)
---
-class Arrow a => ArrowLoop a where
- -- |
- --
- -- > ╭──────────────╮
- -- > b │ ╭───╮ │ c
- -- > >───┼─────┤ ├────┼───>
- -- > │ ┌─┤ ├─┐ │
- -- > │ d │ ╰───╯ │ │
- -- > │ └───<───┘ │
- -- > ╰──────────────╯
- loop :: a (b,d) (c,d) -> a b c
-
--- | @since base-2.01
-instance ArrowLoop (->) where
- loop f b = let (c,d) = f (b,d) in c
-
--- | Beware that for many monads (those for which the '>>=' operation
--- is strict) this instance will /not/ satisfy the right-tightening law
--- required by the 'ArrowLoop' class.
---
--- @since base-2.01
-instance MonadFix m => ArrowLoop (Kleisli m) where
- loop (Kleisli f) = Kleisli (liftM fst . mfix . f')
- where f' x y = f (x, snd y)
=====================================
libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
=====================================
@@ -24,7 +24,10 @@
module GHC.Internal.Control.Monad.Fix (
MonadFix(mfix),
- fix
+ fix,
+ fixIO,
+ -- * Feedback for Arrow
+ ArrowLoop(..)
) where
import GHC.Internal.Data.Either
@@ -34,12 +37,19 @@ import GHC.Internal.Data.Monoid ( Monoid, Dual(..), Sum(..), Product(..)
, First(..), Last(..), Alt(..), Ap(..) )
import GHC.Internal.Data.NonEmpty ( NonEmpty(..) )
import GHC.Internal.Data.Ord ( Down(..) )
-import GHC.Internal.Data.Tuple ( Solo(..), snd )
-import GHC.Internal.Base ( Monad, errorWithoutStackTrace, (.) )
+import GHC.Internal.Data.Tuple ( Solo(..), fst, snd )
+import GHC.Internal.Base ( IO, Monad, errorWithoutStackTrace, (.), return, liftM )
import GHC.Internal.Generics
import GHC.Internal.List ( head, drop )
import GHC.Internal.Control.Monad.ST.Imp
-import GHC.Internal.System.IO
+import qualified GHC.Internal.Control.Monad.ST.Lazy.Imp as Lazy
+import GHC.Internal.Data.Functor.Identity (Identity(..))
+import GHC.Internal.MVar
+import GHC.Internal.IO.Unsafe
+import GHC.Internal.IO.Exception
+import GHC.Internal.TH.Monad
+import GHC.Internal.Control.Exception
+import GHC.Internal.Control.Arrow
-- | Monads having fixed points with a \'knot-tying\' semantics.
-- Instances of 'MonadFix' should satisfy the following laws:
@@ -102,6 +112,86 @@ instance MonadFix NonEmpty where
instance MonadFix IO where
mfix = fixIO
+-- ---------------------------------------------------------------------------
+-- fixIO
+
+-- | The implementation of 'Control.Monad.Fix.mfix' for 'IO'.
+--
+-- This operation may fail with:
+--
+-- * 'FixIOException' if the function passed to 'fixIO' inspects its argument.
+--
+-- ==== __Examples__
+--
+-- the IO-action is only executed once. The recursion is only on the values.
+--
+-- >>> take 3 <$> fixIO (\x -> putStr ":D" >> (:x) <$> readLn @Int)
+-- :D
+-- 2
+-- [2,2,2]
+--
+-- If we are strict in the value, just as with 'Data.Function.fix', we do not get termination:
+--
+-- >>> fixIO (\x -> putStr x >> pure ('x' : x))
+-- * hangs forever *
+--
+-- We can tie the knot of a structure within 'IO' using 'fixIO':
+--
+-- @
+-- data Node = MkNode Int (IORef Node)
+--
+-- foo :: IO ()
+-- foo = do
+-- p \<- fixIO (\p -> newIORef (MkNode 0 p))
+-- q <- output p
+-- r <- output q
+-- _ <- output r
+-- pure ()
+--
+-- output :: IORef Node -> IO (IORef Node)
+-- output ref = do
+-- MkNode x p <- readIORef ref
+-- print x
+-- pure p
+-- @
+--
+-- >>> foo
+-- 0
+-- 0
+-- 0
+fixIO :: (a -> IO a) -> IO a
+fixIO k = do
+ m <- newEmptyMVar
+ ans <- unsafeDupableInterleaveIO
+ (readMVar m `catch` \BlockedIndefinitelyOnMVar ->
+ throwIO FixIOException)
+ result <- k ans
+ putMVar m result
+ return result
+
+-- Note [Blackholing in fixIO]
+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-- We do our own explicit black holing here, because GHC's lazy
+-- blackholing isn't enough. In an infinite loop, GHC may run the IO
+-- computation a few times before it notices the loop, which is wrong.
+--
+-- NOTE2: the explicit black-holing with an IORef ran into trouble
+-- with multiple threads (see #5421), so now we use an MVar. We used
+-- to use takeMVar with unsafeInterleaveIO. This, however, uses noDuplicate#,
+-- which is not particularly cheap. Better to use readMVar, which can be
+-- performed in multiple threads safely, and to use unsafeDupableInterleaveIO
+-- to avoid the noDuplicate cost.
+--
+-- What we'd ideally want is probably an IVar, but we don't quite have those.
+-- STM TVars look like an option at first, but I don't think they are:
+-- we'd need to be able to write to the variable in an IO context, which can
+-- only be done using 'atomically', and 'atomically' is not allowed within
+-- unsafePerformIO. We can't know if someone will try to use the result
+-- of fixIO with unsafePerformIO!
+--
+-- See also System.IO.Unsafe.unsafeFixIO.
+--
+
-- | @since base-2.01
instance MonadFix ((->) r) where
mfix f = \ r -> let a = f a r in a
@@ -116,6 +206,10 @@ instance MonadFix (Either e) where
instance MonadFix (ST s) where
mfix = fixST
+-- | @since base-2.01
+instance MonadFix (Lazy.ST s) where
+ mfix = Lazy.fixST
+
-- Instances of Data.Monoid wrappers
-- | @since base-4.8.0.0
@@ -171,3 +265,77 @@ instance (MonadFix f, MonadFix g) => MonadFix (f :*: g) where
-- | @since base-4.12.0.0
instance MonadFix Down where
mfix f = Down (fix (getDown . f))
+
+
+-- | @since base-4.8.0.0
+instance MonadFix Identity where
+ mfix f = Identity (fix (runIdentity . f))
+
+-- | If the function passed to 'mfix' inspects its argument,
+-- the resulting action will throw a 'FixIOException'.
+--
+-- @since 2.17.0.0
+instance MonadFix Q where
+ -- We use the same blackholing approach as in fixIO.
+ -- See Note [Blackholing in fixIO].
+ mfix k = do
+ m <- runIO newEmptyMVar
+ ans <- runIO (unsafeDupableInterleaveIO
+ (readMVar m `catch` \BlockedIndefinitelyOnMVar ->
+ throwIO FixIOException))
+ result <- k ans
+ runIO (putMVar m result)
+ return result
+
+-- | The 'loop' operator expresses computations in which an output value
+-- is fed back as input, although the computation occurs only once.
+-- It underlies the @rec@ value recursion construct in arrow notation.
+-- 'loop' should satisfy the following laws:
+--
+-- [/extension/]
+-- @'loop' ('arr' f) = 'arr' (\\ b -> 'fst' ('fix' (\\ (c,d) -> f (b,d))))@
+--
+-- [/left tightening/]
+-- @'loop' ('first' h >>> f) = h >>> 'loop' f@
+--
+-- [/right tightening/]
+-- @'loop' (f >>> 'first' h) = 'loop' f >>> h@
+--
+-- [/sliding/]
+-- @'loop' (f >>> 'arr' ('id' *** k)) = 'loop' ('arr' ('id' *** k) >>> f)@
+--
+-- [/vanishing/]
+-- @'loop' ('loop' f) = 'loop' ('arr' unassoc >>> f >>> 'arr' assoc)@
+--
+-- [/superposing/]
+-- @'second' ('loop' f) = 'loop' ('arr' assoc >>> 'second' f >>> 'arr' unassoc)@
+--
+-- where
+--
+-- > assoc ((a,b),c) = (a,(b,c))
+-- > unassoc (a,(b,c)) = ((a,b),c)
+--
+class Arrow a => ArrowLoop a where
+ -- |
+ --
+ -- > ╭──────────────╮
+ -- > b │ ╭───╮ │ c
+ -- > >───┼─────┤ ├────┼───>
+ -- > │ ┌─┤ ├─┐ │
+ -- > │ d │ ╰───╯ │ │
+ -- > │ └───<───┘ │
+ -- > ╰──────────────╯
+ loop :: a (b,d) (c,d) -> a b c
+
+-- | @since base-2.01
+instance ArrowLoop (->) where
+ loop f b = let (c,d) = f (b,d) in c
+
+-- | Beware that for many monads (those for which the '>>=' operation
+-- is strict) this instance will /not/ satisfy the right-tightening law
+-- required by the 'ArrowLoop' class.
+--
+-- @since base-2.01
+instance MonadFix m => ArrowLoop (Kleisli m) where
+ loop (Kleisli f) = Kleisli (liftM fst . mfix . f')
+ where f' x y = f (x, snd y)
=====================================
libraries/ghc-internal/src/GHC/Internal/Control/Monad/ST/Lazy/Imp.hs
=====================================
@@ -37,7 +37,6 @@ module GHC.Internal.Control.Monad.ST.Lazy.Imp (
unsafeIOToST
) where
-import GHC.Internal.Control.Monad.Fix
import GHC.Internal.Data.Tuple
import qualified GHC.Internal.Control.Monad.ST.Imp as ST
@@ -210,10 +209,6 @@ fixST m = ST (\ s ->
-- itself is demanded directly in the `let` body. See also
-- Note [Lazy ST: not producing lazy pairs].
--- | @since base-2.01
-instance MonadFix (ST s) where
- mfix = fixST
-
-- | @since base-4.23.0.0
instance Semigroup a => Semigroup (ST s a) where
(<>) = liftA2 (<>)
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs
=====================================
@@ -33,7 +33,6 @@ module GHC.Internal.Data.Functor.Identity (
Identity(..),
) where
-import GHC.Internal.Control.Monad.Fix
import GHC.Internal.Data.Bits (Bits, FiniteBits)
import GHC.Internal.Data.Coerce
import GHC.Internal.Data.Foldable
@@ -143,7 +142,3 @@ instance Applicative Identity where
-- | @since base-4.8.0.0
instance Monad Identity where
m >>= k = k (runIdentity m)
-
--- | @since base-4.8.0.0
-instance MonadFix Identity where
- mfix f = Identity (fix (runIdentity . f))
=====================================
libraries/ghc-internal/src/GHC/Internal/Event/Windows/ManagedThreadPool.hs
=====================================
@@ -35,7 +35,7 @@ import GHC.Internal.Real (fromIntegral)
import qualified GHC.Internal.Event.Array as A
import GHC.Internal.IO.Handle.Internals (debugIO)
import GHC.Internal.Conc.Sync (ThreadId(..))
-import GHC.Internal.RTS.Flags
+import GHC.Internal.RTS.Flags.Test
------------------------------------------------------------------------
-- Thread spool manager
@@ -60,7 +60,7 @@ startThreadPool job = do
let thrMinThreads = 2
let thrCurThreads = 0
let thrCallBack = job
- thrMaxThreads <- (fromIntegral . numIoWorkerThreads) `fmap` getMiscFlags
+ thrMaxThreads <- getNumIoWorkerThreads
thrActiveThreads <- newMVar 0
thrMonitor <- newEmptyMVar
thrThreadIds <- undefined -- A.new thrMaxThreads
=====================================
libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc
=====================================
@@ -4,24 +4,23 @@
-- that allows to quickly test if some flag is set.
module GHC.Internal.RTS.Flags.Test
( getUserEventTracingEnabled
+ , getNumIoWorkerThreads
)
where
import GHC.Internal.Base
-
-#if !defined(javascript_HOST_ARCH)
-
import GHC.Internal.Ptr
import GHC.Internal.Foreign.C.Types
import GHC.Internal.Foreign.Marshal.Utils
import GHC.Internal.Foreign.Storable
import GHC.Internal.Data.Functor ((<$>))
+import GHC.Internal.Word (Word32)
+import GHC.Internal.Real (fromIntegral)
#include "Rts.h"
#include "rts/Flags.h"
foreign import ccall "&RtsFlags" rtsFlagsPtr :: Ptr ()
-#endif
-- | Specialized version of 'getTraceFlags' for just checking if user
-- event tracing is enabled.
@@ -34,3 +33,9 @@ getUserEventTracingEnabled = do
let ptr = (#ptr RTS_FLAGS, TraceFlags) rtsFlagsPtr
toBool <$> (#{peek TRACE_FLAGS, user} ptr :: IO CBool)
#endif
+
+-- | Specialized version of 'getMiscFlags' for just checking the number of IO worker threads
+getNumIoWorkerThreads :: IO Int
+getNumIoWorkerThreads = do
+ let ptr = (#ptr RTS_FLAGS, MiscFlags) rtsFlagsPtr
+ fromIntegral <$> (#{peek MISC_FLAGS, numIoWorkerThreads} ptr :: IO Word32)
=====================================
libraries/ghc-internal/src/GHC/Internal/System/IO.hs
=====================================
@@ -20,7 +20,6 @@ module GHC.Internal.System.IO (
-- * The IO monad
IO,
- fixIO,
-- * Files and handles
@@ -258,7 +257,6 @@ import GHC.Internal.IO.Encoding
import GHC.Internal.Text.Read
import GHC.Internal.IO.StdHandles
import GHC.Internal.Show
-import GHC.Internal.MVar
-----------------------------------------------------------------------------
-- Standard IO
@@ -602,87 +600,6 @@ hReady h = hWaitForInput h 0
hPrint :: Show a => Handle -> a -> IO ()
hPrint hdl = hPutStrLn hdl . show
-
--- ---------------------------------------------------------------------------
--- fixIO
-
--- | The implementation of 'Control.Monad.Fix.mfix' for 'IO'.
---
--- This operation may fail with:
---
--- * 'FixIOException' if the function passed to 'fixIO' inspects its argument.
---
--- ==== __Examples__
---
--- the IO-action is only executed once. The recursion is only on the values.
---
--- >>> take 3 <$> fixIO (\x -> putStr ":D" >> (:x) <$> readLn @Int)
--- :D
--- 2
--- [2,2,2]
---
--- If we are strict in the value, just as with 'Data.Function.fix', we do not get termination:
---
--- >>> fixIO (\x -> putStr x >> pure ('x' : x))
--- * hangs forever *
---
--- We can tie the knot of a structure within 'IO' using 'fixIO':
---
--- @
--- data Node = MkNode Int (IORef Node)
---
--- foo :: IO ()
--- foo = do
--- p \<- fixIO (\p -> newIORef (MkNode 0 p))
--- q <- output p
--- r <- output q
--- _ <- output r
--- pure ()
---
--- output :: IORef Node -> IO (IORef Node)
--- output ref = do
--- MkNode x p <- readIORef ref
--- print x
--- pure p
--- @
---
--- >>> foo
--- 0
--- 0
--- 0
-fixIO :: (a -> IO a) -> IO a
-fixIO k = do
- m <- newEmptyMVar
- ans <- unsafeDupableInterleaveIO
- (readMVar m `catch` \BlockedIndefinitelyOnMVar ->
- throwIO FixIOException)
- result <- k ans
- putMVar m result
- return result
-
--- Note [Blackholing in fixIO]
--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- We do our own explicit black holing here, because GHC's lazy
--- blackholing isn't enough. In an infinite loop, GHC may run the IO
--- computation a few times before it notices the loop, which is wrong.
---
--- NOTE2: the explicit black-holing with an IORef ran into trouble
--- with multiple threads (see #5421), so now we use an MVar. We used
--- to use takeMVar with unsafeInterleaveIO. This, however, uses noDuplicate#,
--- which is not particularly cheap. Better to use readMVar, which can be
--- performed in multiple threads safely, and to use unsafeDupableInterleaveIO
--- to avoid the noDuplicate cost.
---
--- What we'd ideally want is probably an IVar, but we don't quite have those.
--- STM TVars look like an option at first, but I don't think they are:
--- we'd need to be able to write to the variable in an IO context, which can
--- only be done using 'atomically', and 'atomically' is not allowed within
--- unsafePerformIO. We can't know if someone will try to use the result
--- of fixIO with unsafePerformIO!
---
--- See also System.IO.Unsafe.unsafeFixIO.
---
-
-- | The function creates a temporary file in ReadWrite mode.
-- The created file isn\'t deleted automatically, so you need to delete it manually.
--
=====================================
libraries/ghc-internal/src/GHC/Internal/TH/Monad.hs
=====================================
@@ -28,13 +28,8 @@ import Data.Data hiding (Fixity(..))
import Data.IORef
import System.IO.Unsafe ( unsafePerformIO )
import Control.Monad.IO.Class (MonadIO (..))
-import Control.Monad.Fix (MonadFix (..))
-import Control.Exception (BlockedIndefinitelyOnMVar (..), catch, throwIO)
-import Control.Exception.Base (FixIOException (..))
-import Control.Concurrent.MVar (newEmptyMVar, readMVar, putMVar)
import System.IO ( hPutStrLn, stderr )
import qualified Data.Kind as Kind (Type)
-import GHC.IO.Unsafe ( unsafeDupableInterleaveIO )
import GHC.Types (TYPE, RuntimeRep(..))
#else
import GHC.Internal.Base hiding (NonEmpty(..),Type, Module, sequence)
@@ -46,12 +41,8 @@ import GHC.Internal.Data.Foldable
import GHC.Internal.Data.Typeable
import GHC.Internal.Control.Monad.IO.Class
import GHC.Internal.Control.Monad.Fail
-import GHC.Internal.Control.Monad.Fix
-import GHC.Internal.Control.Exception
import GHC.Internal.Num
import GHC.Internal.IO.Unsafe
-import GHC.Internal.MVar
-import GHC.Internal.IO.Exception
import qualified GHC.Internal.Types as Kind (Type)
#endif
import GHC.Internal.ForeignSrcLang
@@ -258,22 +249,6 @@ instance Semigroup a => Semigroup (Q a) where
instance Monoid a => Monoid (Q a) where
mempty = pure mempty
--- | If the function passed to 'mfix' inspects its argument,
--- the resulting action will throw a 'FixIOException'.
---
--- @since 2.17.0.0
-instance MonadFix Q where
- -- We use the same blackholing approach as in fixIO.
- -- See Note [Blackholing in fixIO] in System.IO in base.
- mfix k = do
- m <- runIO newEmptyMVar
- ans <- runIO (unsafeDupableInterleaveIO
- (readMVar m `catch` \BlockedIndefinitelyOnMVar ->
- throwIO FixIOException))
- result <- k ans
- runIO (putMVar m result)
- return result
-
-----------------------------------------------------
--
=====================================
testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
=====================================
@@ -41,10 +41,10 @@ data Tuple2 a b = (,) a b
-- Defined in ‘GHC.Internal.Tuple’
instance Traversable (Tuple2 a)
-- Defined in ‘GHC.Internal.Data.Traversable’
-instance Foldable (Tuple2 a)
- -- Defined in ‘GHC.Internal.Data.Foldable’
instance Monoid a => Applicative (Tuple2 a)
-- Defined in ‘GHC.Internal.Base’
+instance Foldable (Tuple2 a)
+ -- Defined in ‘GHC.Internal.Data.Foldable’
instance Functor (Tuple2 a) -- Defined in ‘GHC.Internal.Base’
instance Monoid a => Monad (Tuple2 a)
-- Defined in ‘GHC.Internal.Base’
=====================================
testsuite/tests/ghci/scripts/T10963.stderr
=====================================
@@ -1,4 +1,3 @@
-
<interactive>:1:1: error: [GHC-39999]
• Ambiguous type variable ‘a0’ arising from a use of ‘foo’
prevents the constraint ‘(Num a0)’ from being solved.
@@ -10,3 +9,4 @@
...plus one instance involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the expression: foo
+
=====================================
testsuite/tests/ghci/scripts/T4175.stdout
=====================================
@@ -44,8 +44,8 @@ instance Traversable Maybe
-- Defined in ‘GHC.Internal.Data.Traversable’
instance MonadFail Maybe
-- Defined in ‘GHC.Internal.Control.Monad.Fail’
-instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’
+instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
instance Functor Maybe -- Defined in ‘GHC.Internal.Base’
instance Monad Maybe -- Defined in ‘GHC.Internal.Base’
instance Semigroup a => Monoid (Maybe a)
=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -11527,8 +11527,6 @@ instance GHC.Internal.Control.Arrow.ArrowApply (->) -- Defined in ‘GHC.Interna
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Arrow.ArrowApply (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance GHC.Internal.Control.Arrow.ArrowChoice (->) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Arrow.ArrowChoice (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance GHC.Internal.Control.Arrow.ArrowLoop (->) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance forall (m :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Arrow.ArrowLoop (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.MonadPlus m => GHC.Internal.Control.Arrow.ArrowPlus (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.MonadPlus m => GHC.Internal.Control.Arrow.ArrowZero (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
instance forall (m :: * -> *). GHC.Internal.Base.Monad m => GHC.Internal.Control.Category.Category (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Arrow’
@@ -11544,6 +11542,8 @@ instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fail.MonadFail f => GH
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.P -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.ReadP -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadPrec.ReadPrec -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadPrec’
+instance GHC.Internal.Control.Monad.Fix.ArrowLoop (->) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall (m :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Monad.Fix.ArrowLoop (GHC.Internal.Control.Arrow.Kleisli m) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11553,6 +11553,7 @@ instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Ei
instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11560,14 +11561,14 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Maybe.Maybe -- Def
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.ST.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix Solo -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall a. GHC.Internal.Base.Monoid a => GHC.Internal.Control.Monad.Fix.MonadFix ((,) a) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.ST.Lazy.Imp’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Complex.Complex -- Defined in ‘Data.Complex’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Functor.Identity’
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.First -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
=====================================
testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
=====================================
@@ -11580,6 +11580,7 @@ instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Ei
instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11587,14 +11588,14 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Maybe.Maybe -- Def
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.ST.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix Solo -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall a. GHC.Internal.Base.Monoid a => GHC.Internal.Control.Monad.Fix.MonadFix ((,) a) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.ST.Lazy.Imp’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Complex.Complex -- Defined in ‘Data.Complex’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Functor.Identity’
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.First -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
=====================================
testsuite/tests/interface-stability/base-exports.stdout-mingw32
=====================================
@@ -11811,6 +11811,7 @@ instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Ei
instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11818,14 +11819,14 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Maybe.Maybe -- Def
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.ST.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix Solo -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall a. GHC.Internal.Base.Monoid a => GHC.Internal.Control.Monad.Fix.MonadFix ((,) a) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.ST.Lazy.Imp’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Complex.Complex -- Defined in ‘Data.Complex’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Functor.Identity’
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.First -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
=====================================
testsuite/tests/interface-stability/base-exports.stdout-ws-32
=====================================
@@ -11553,6 +11553,7 @@ instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Ei
instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11560,14 +11561,14 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Maybe.Maybe -- Def
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
+instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.ST.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix Solo -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall a. GHC.Internal.Base.Monoid a => GHC.Internal.Control.Monad.Fix.MonadFix ((,) a) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Control.Monad.ST.Lazy.Imp.ST s) -- Defined in ‘GHC.Internal.Control.Monad.ST.Lazy.Imp’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Complex.Complex -- Defined in ‘Data.Complex’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Functor.Identity’
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.First -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
=====================================
testsuite/tests/interface-stability/template-haskell-exports.stdout
=====================================
@@ -2052,7 +2052,6 @@ instance GHC.Internal.Classes.Ord GHC.Internal.TH.Syntax.Type -- Defined in ‘G
instance GHC.Internal.Classes.Ord GHC.Internal.TH.Syntax.TypeFamilyHead -- Defined in ‘GHC.Internal.TH.Syntax’
instance GHC.Internal.Classes.Ord GHC.Internal.LanguageExtensions.Extension -- Defined in ‘GHC.Internal.LanguageExtensions’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.TH.Monad’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.TH.Monad’
instance GHC.Internal.Control.Monad.IO.Class.MonadIO GHC.Internal.TH.Monad.Q -- Defined in ‘GHC.Internal.TH.Monad’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.TH.Syntax.TyVarBndr -- Defined in ‘GHC.Internal.TH.Syntax’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.TH.Syntax.TyVarBndr -- Defined in ‘GHC.Internal.TH.Syntax’
=====================================
testsuite/tests/mdo/should_fail/mdofail006.stderr
=====================================
@@ -5,5 +5,5 @@ cyclic evaluation in fixIO
While handling thread blocked indefinitely in an MVar operation
HasCallStack backtrace:
- throwIO, called at libraries/ghc-internal/src/GHC/Internal/System/IO.hs:641:37 in ghc-internal:GHC.Internal.System.IO
+ throwIO, called at libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs:167:37 in ghc-internal:GHC.Internal.Control.Monad.Fix
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c6c69769680a41edfc0aa91b5f81101…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c6c69769680a41edfc0aa91b5f81101…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26868] 53 commits: Remove exprIsCheap from doFloatFromRhs
by Simon Peyton Jones (@simonpj) 20 Feb '26
by Simon Peyton Jones (@simonpj) 20 Feb '26
20 Feb '26
Simon Peyton Jones pushed to branch wip/T26868 at Glasgow Haskell Compiler / GHC
Commits:
2b4f463c by Simon Peyton Jones at 2026-02-02T17:32:32+00:00
Remove exprIsCheap from doFloatFromRhs
See #26854 and Note [Float when expandable]
This patch simplifies the code, by removing an extra unnecessary test.
- - - - -
9db7f21f by Brandon Chinn at 2026-02-03T09:15:10-05:00
Refactor: make function patterns exhaustive
Also added missing (==) logic for:
* HsMultilineString
* HsInt{8,16,32}
* HsWord{8,16,32}
- - - - -
aa9c5e2c by Hécate Kleidukos at 2026-02-03T15:58:35-05:00
driver: Hide source paths at verbosity level 1 by default
- - - - -
c64cca1e by mangoiv at 2026-02-03T15:59:29-05:00
ExplicitLevelImports: check staging for types just like for values
Previously, imported types were entirely exempted from staging checks as
the implicit stage persistance assumed to be all imported types to be
well staged. ExplicitLevelImports' change specification, however, does
not do such an exemption. Thus we want to introduce such a check, just
like we have for values.
ExplicitLevelImports does not, however, talk about local names - from
its perspective, we could theoretically keep treating locally introduced
types specially - e.g. an ill-staged used in a quote would only emit a
warning, not an error. To allow for a potential future migration away
from such wrinkles as the staging check in notFound
(see Note [Out of scope might be a staging error]) we consistently do
the strict staging check that we also do for value if ExplicitLevelImports
is on.
Closes #26098
- - - - -
5f0dbeb6 by Simon Hengel at 2026-02-03T16:00:12-05:00
Use Haddock formatting in deprecation message of `initNameCache`
- - - - -
01ecb612 by Andreas Klebinger at 2026-02-04T09:56:25-05:00
testsuite: Explicitly use utf-8 encoding in rts-includes linter.
Not doing so caused failures on windows, as python failed to pick a
reasonable encoding even with locale set.
Fixes #26850
- - - - -
ea0d1317 by Zubin Duggal at 2026-02-04T09:57:06-05:00
Bump transformers submodule to 0.6.3.0
Fixes #26790
- - - - -
cbe4300e by Simon Peyton Jones at 2026-02-05T04:31:04-05:00
Fix subtle bug in GHC.Core.Utils.mkTick
This patch fixes a decade-old bug in `mkTick`, which
could generate type-incorrect code! See the diagnosis
in #26772.
The new code is simpler and easier to understand.
(As #26772 says, I think it could be improved further.)
- - - - -
a193a8da by Simon Peyton Jones at 2026-02-05T04:31:04-05:00
Modify a debug-trace in the Simplifier
...just to show a bit more information.
- - - - -
b579dfdc by Simon Peyton Jones at 2026-02-05T04:31:04-05:00
Fix long-standing interaction between ticks and casts
The code for Note [Eliminate Identity Cases] was simply wrong when
ticks and casts interacted. This patch fixes the interaction.
It was shown up when validating #26772, although it's not the exactly
the bug that's reported by #26772. Nor is it easy to reproduce, hence
no regression test.
- - - - -
fac0de1e by Cheng Shao at 2026-02-05T04:31:49-05:00
libraries: bump Cabal submodule to 3.16.1.0
- - - - -
00589122 by Cheng Shao at 2026-02-05T04:31:49-05:00
libraries: bump deepseq submodule to 1.5.2.0
Also:
- Get rid of usage of deprecated `NFData` function instance in the
compiler
- `T21391` still relies on `NFData` function instance, add
`-Wno-deprecations` for the time being.
- - - - -
84474c71 by Cheng Shao at 2026-02-05T04:31:50-05:00
libraries: bump directory submodule to 1.3.10.1
- - - - -
1a9f4662 by Cheng Shao at 2026-02-05T04:31:50-05:00
libraries: bump exceptions submodule to 0.10.12
- - - - -
2e39a340 by Peng Fan at 2026-02-07T03:42:01-05:00
NCG/LA64: adjust register usage to avoid src-register being clobbered
- - - - -
9faf1b35 by Teo Camarasu at 2026-02-07T03:42:43-05:00
ghc-internal: Delete unnecessary GHC.Internal.Data.Ix
This module merely re-exports GHC.Internal.Ix. It was copied from
`base` when `ghc-internal` was split, but there is no reason to have
this now. So, let's delete it.
Resolves #26848
- - - - -
d112b440 by Sven Tennie at 2026-02-07T10:47:56-05:00
Add cabal.project file to generate-ci
This fixes the HLS setup for our CI code generation script
(generate-ci).
The project file simply makes `generate-ci` of the cabal file
discoverable.
- - - - -
5339f6f0 by Andreas Klebinger at 2026-02-07T10:48:40-05:00
CI: Don't collapse test results.
This puts test output back into the primary test log instead of a
subsection removing the need to expand a section to see test results.
While the intention was good in practice the old behaviour mostly wastes time
by requiring expansion of the section.
Fixes #26882
- - - - -
0e1cd2e0 by Evan Piro at 2026-02-08T10:35:16-08:00
Linker.MacOS reduce dynflags import
- - - - -
1c79a4cd by Michael Alan Dorman at 2026-02-09T08:11:51-05:00
Remove `extra_src_files` variable from `testsuite/driver/testlib.py`
While reading through the test harness code, I noticed this variable
with a TODO attached that referenced #12223. Although that bug is
closed, it strongly implied that this special-case variable that only
affected a single test was expected to be removed at some point.
I also looked at 3415bcaa0b1903b5e12dfaadb5b774718e406eab---where it
was added---whose commit message suggested that it would have been
desirable to remove it, but that there were special circumstances that
meant it had to remain (though it doesn't elucidate what those special
circumstances are).
However, the special circumstances were mentioned as if the test was
in a different location than is currently is, so I decided to try
changing the test to use the standard `extra_files` mechanism, which
works in local testing.
This also seems like a reasonable time to remove the script that was
originally used in the transition, since it doesn't really serve a
purpose anymore.
- - - - -
0020e38a by Matthew Pickering at 2026-02-09T17:29:14-05:00
determinism: Use a stable sort in WithHsDocIdentifiers binary instance
`WithHsDocIdentifiers` is defined as
```
71 data WithHsDocIdentifiers a pass = WithHsDocIdentifiers
72 { hsDocString :: !a
73 , hsDocIdentifiers :: ![Located (IdP pass)]
74 }
```
This list of names is populated from `rnHsDocIdentifiers`, which calls
`lookupGRE`, which calls `lookupOccEnv_AllNameSpaces`, which calls
`nonDetEltsUFM` and returns the results in an order depending on
uniques.
Sorting the list with a stable sort before returning the interface makes
the output deterministic and follows the approach taken by other fields
in `Docs`.
Fixes #26858
- - - - -
89898ce6 by echoumcp1 at 2026-02-09T17:30:01-05:00
Replace putstrln with logMsg in handleSeqHValueStatus
Fixes #26549
- - - - -
7c52c4f9 by John Paul Adrian Glaubitz at 2026-02-10T13:52:43-05:00
rts: Switch prim to use modern atomic compiler builtins
The __sync_*() atomic compiler builtins have been deprecated in GCC
for a while now and also don't provide variants for 64-bit values
such as __sync_fetch_and_add_8().
Thus, replace them with the modern __atomic_*() compiler builtins and
while we're at it, also drop the helper macro CAS_NAND() which is now
no longer needed since we stopped using the __sync_*() compiler builtins
altogether.
Co-authored-by: Ilias Tsitsimpis <iliastsi(a)debian.org>
Fixes #26729
- - - - -
cf60850a by Recursion Ninja at 2026-02-10T13:53:27-05:00
Decoupling L.H.S.Decls from GHC.Types.ForeignCall
- Adding TTG extension point for 'CCallTarget'
- Adding TTG extension point for 'CType'
- Adding TTG extension point for 'Header'
- Moving ForeignCall types that do not need extension
to new L.H.S.Decls.Foreign module
- Replacing 'Bool' parameters with descriptive data-types
to increase clairty and prevent "Boolean Blindness"
- - - - -
11a04cbb by Eric Lee at 2026-02-11T09:20:46-05:00
Derive Semigroup/Monoid for instances believed could be derived in #25871
- - - - -
15d9ce44 by Eric Lee at 2026-02-11T09:20:46-05:00
add Ghc.Data.Pair deriving
- - - - -
c85dc170 by Evan Piro at 2026-02-11T09:21:45-05:00
Linker.MacOS reduce options import
- - - - -
a541dd83 by Chris Wendt at 2026-02-11T16:06:41-05:00
Initialize plugins for `:set +c` in GHCi
Fixes #23110.
- - - - -
0f5a73bc by Cheng Shao at 2026-02-11T16:07:27-05:00
compiler: add Binary Text instance
This patch adds `Binary` instance for strict `Text`, in preparation of
making `Text` usable in certain GHC API use cases (e.g. haddock). This
also introduces `text` as a direct dependency of the `ghc` package.
- - - - -
9e58b8a1 by Cheng Shao at 2026-02-11T16:08:10-05:00
ghc-toolchain: add C11 check
This patch partially reverts commit
b8307eab80c5809df5405d76c822bf86877f5960 that removed C99 check in
autoconf/ghc-toolchain. Now we:
- No longer re-implement `FP_SET_CFLAGS_C11` similar to
`FP_SET_CFLAGS_C99` in the past, since autoconf doesn't provide a
convenient `AC_PROG_CC_C11` function. ghc-toolchain will handle it
anyway.
- The Cmm CPP C99 check is relanded and repurposed for C11.
- The C99 logic in ghc-toolchain is relanded and repurposed for C11.
- The C99 check in Stg.h is corrected to check for C11. The obsolete
_ISOC99_SOURCE trick is dropped.
- Usages of `-std=gnu99` in the testsuite are corrected to use
`-std=gnu11`.
Closes #26908.
- - - - -
4df0adf6 by Simon Peyton Jones at 2026-02-11T21:50:13-05:00
Simplify the treatment of static forms
This MR implements GHC proposal 732: simplify static forms,
https://github.com/ghc-proposals/ghc-proposals/pull/732
thereby addressing #26556.
See `Note [Grand plan for static forms]` in GHC.Iface.Tidy.StaticPtrTable
The main changes are:
* There is a new, simple rule for (static e), namely that the free
term variables of `e` must be bound at top level. The check is
done in the `HsStatic` case of `GHC.Rename.Expr.rnExpr`
* That in turn substantially simplifies the info that the typechecker
carries around in its type environment. Hooray.
* The desugarer emits static bindings to top level directly; see the
`HsStatic` case of `dsExpr`.
* There is no longer any special static-related magic in the FloatOut
pass. And the main Simplifier pipeline no longer needs a special case
to run FloatOut even with -O0. Hooray.
All this forced an unexpected change to the pattern match checker. It
recursively invokes the main Hs desugarer when it wants to take a look
at a term to spot some special cases (notably constructor applications).
We don't want to emit any nested (static e) bindings to top level a
second time! Yikes.
That forced a modest refactor in GHC.HsToCore.Pmc:
* The `dsl_nablas` field of `DsLclEnv` now has a `NoPmc` case, which says
"I'm desugaring just for pattern-match checking purposes".
* When that flag is set we don't emit static binds.
That in turn forces a cascade of refactoring, but the net effect is an
improvement; less risk of duplicated (even exponential?) work.
See Note [Desugaring HsExpr during pattern-match checking].
10% metric decrease, on some architectures, of compile-time max-bytes-used on T15304.
Metric Decrease:
T15304
- - - - -
7922f728 by Teo Camarasu at 2026-02-11T21:50:58-05:00
ghc-internal: avoid depending on GHC.Internal.Exts
This module is mostly just re-exports. It made sense as a user-facing
module, but there's no good reason ghc-internal modules should depend on
it and doing so linearises the module graph
- move considerAccessible to GHC.Internal.Magic
Previously it lived in GHC.Internal.Exts, but it really deserves to live
along with the other magic function, which are already re-exported from .Exts
- move maxTupleSize to GHC.Internal.Tuple
This previously lived in GHC.Internal.Exts but a comment already said it
should be moved to .Tuple
Resolves #26832
- - - - -
b6a4a29b by Eric Lee at 2026-02-11T21:51:55-05:00
Remove unused Semigroup imports to fix GHC 9.14 bootstrapping
- - - - -
99d8c146 by Simon Peyton Jones at 2026-02-12T17:36:59+00:00
Fix subtle bug in cast worker/wrapper
See (CWw4) in Note [Cast worker/wrapper].
The true payload is in the change to the definition of
GHC.Types.Id.Info.hasInlineUnfolding
Everthing else is just documentation.
There is a 2% compile time decrease for T13056;
I'll take the win!
Metric Decrease:
T13056
- - - - -
530e8e58 by Simon Peyton Jones at 2026-02-12T20:17:23-05:00
Add regression tests for four StaticPtr bugs
Tickets #26545, #24464, #24773, #16981 are all solved by the
recently-landed MR
commit 318ee13bcffa6aa8df42ba442ccd92aa0f7e210c
Author: Simon Peyton Jones <simon.peytonjones(a)gmail.com>
Date: Mon Oct 20 23:07:20 2025 +0100
Simplify the treatment of static forms
This MR just adds regression tests for them.
- - - - -
4157160f by Cheng Shao at 2026-02-13T06:27:04-05:00
ci: remove unused hlint-ghc-and-base job definition
This patch removes the unused `hlint-ghc-and-base` job definition,
it's never run since !9806. Note that hadrian lint rules still work
locally, so anyone that wishes to run hlint on the codebase can
continue to do so in their local worktree.
- - - - -
039f1977 by Cheng Shao at 2026-02-13T06:27:47-05:00
wasm: use import.meta.main for proper distinction of nodejs main modules
This patch uses `import.meta.main` for proper distinction of nodejs
main modules, especially when the main module might be installed as a
symlink. Fixes #26916.
- - - - -
14f485ee by ARATA Mizuki at 2026-02-17T09:09:24+09:00
Support more x86 extensions: AVX-512 {BW,DQ,VL} and GFNI
Also, mark AVX-512 ER and PF as deprecated.
AVX-512 instructions can be used for certain 64-bit integer vector operations.
GFNI can be used to implement bitReverse (currently not used by NCG, but LLVM may use it).
Closes #26406
Addresses #26509
- - - - -
016f79d5 by fendor at 2026-02-17T09:16:16-05:00
Hide implementation details from base exception stack traces
Ensure we hide the implementation details of the exception throwing mechanisms:
* `undefined`
* `throwSTM`
* `throw`
* `throwIO`
* `error`
The `HasCallStackBacktrace` should always have a length of exactly 1,
not showing internal implementation details in the stack trace, as these
are vastly distracting to end users.
CLC proposal [#387](https://github.com/haskell/core-libraries-committee/issues/387)
- - - - -
4f2840f2 by Brian J. Cardiff at 2026-02-17T17:04:08-05:00
configure: Accept happy-2.2
In Jan 2026 happy-2.2 was released. The most sensible change is https://github.com/haskell/happy/issues/335 which didn't trigger in a fresh build
- - - - -
10b4d364 by Duncan Coutts at 2026-02-17T17:04:52-05:00
Fix errors in the documentation of the eventlog STOP_THREAD status codes
Fix the code for BlockedOnMsgThrowTo.
Document all the known historical warts.
Fixes issue #26867
- - - - -
c5e15b8b by Phil de Joux at 2026-02-18T05:07:36-05:00
haddock: use snippets for all list examples
- generate snippet output for docs
- reduce font size to better fit snippets
- Use only directive to guard html snippets
- Add latex snippets for lists
- - - - -
d388bac1 by Phil de Joux at 2026-02-18T05:07:36-05:00
haddock: Place the snippet input and output together
- Put the output seemingly inside the example box
- - - - -
016fa306 by Samuel Thibault at 2026-02-18T05:08:35-05:00
Fix linking against libm by moving the -lm option
For those systems that need -lm for getting math functions, this is
currently added on the link line very early, before the object files being
linked together. Newer toolchains enable --as-needed by default, which means
-lm is ignored at that point because no object requires a math function
yet. With such toolchains, we thus have to add -lm after the objects, so the
linker actually includes libm in the link.
- - - - -
68bd0805 by Teo Camarasu at 2026-02-18T05:09:19-05:00
ghc-internal: Move GHC.Internal.Data.Bool to base
This is a tiny module that only defines bool :: Bool -> a -> a -> a. We can just move this to base and delete it from ghc-internal. If we want this functionality there we can just use a case statement or if-then expression.
Resolves 26865
- - - - -
4c40df3d by fendor at 2026-02-20T10:24:48-05:00
Add optional `SrcLoc` to `StackAnnotation` class
`StackAnnotation`s give access to an optional `SrcLoc` field that
user-added stack annotations can use to provide better backtraces in both error
messages and when decoding the callstack.
We update builtin stack annotations such as `StringAnnotation` and
`ShowAnnotation` to also capture the `SrcLoc` of the current `CallStack`
to improve backtraces by default (if stack annotations are used).
This change is backwards compatible with GHC 9.14.1.
- - - - -
fd9aaa28 by Simon Hengel at 2026-02-20T10:25:33-05:00
docs: Fix grammar in explicit_namespaces.rst
- - - - -
df3cf896 by Simon Peyton Jones at 2026-02-20T17:48:02+00:00
Beef up Core Lint to check for shadowing
- - - - -
a4c40be0 by Simon Peyton Jones at 2026-02-20T17:48:02+00:00
comments only [skip ci]
- - - - -
53a47bac by Simon Peyton Jones at 2026-02-20T17:49:29+00:00
Refactor free-variable finding
Removes duplication, hopefully improves efficiency
- - - - -
a9d0e96f by Simon Peyton Jones at 2026-02-20T17:49:36+00:00
Wibbles
- - - - -
dc6c4877 by Simon Peyton Jones at 2026-02-20T17:49:36+00:00
Wibbles
- - - - -
80d4c3c3 by Simon Peyton Jones at 2026-02-20T17:49:36+00:00
Wibbles
- - - - -
381 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- + .gitlab/generate-ci/cabal.project
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/CmmToAsm/Config.hs
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/FVs.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/Subst.hs
- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg.hs
- compiler/GHC/CoreToStg/AddImplicitBinds.hs
- compiler/GHC/Data/Pair.hs
- compiler/GHC/Driver/Config/CmmToAsm.hs
- compiler/GHC/Driver/Config/Core/Lint.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/HsToCore/Foreign/Call.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- compiler/GHC/HsToCore/Foreign/JavaScript.hs
- compiler/GHC/HsToCore/Foreign/Utils.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/HsToCore/GuardedRHSs.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Pmc/Solver/Types.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/HsToCore/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Iface/Tidy/StaticPtrTable.hs
- compiler/GHC/Linker/Dynamic.hs
- compiler/GHC/Linker/MacOS.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Expr.hs-boot
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Splice.hs-boot
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Heap/Inspect.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm/Foreign.hs
- compiler/GHC/StgToJS/FFI.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Instance/FunDeps.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/BasicTypes.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- − compiler/GHC/Tc/Utils/TcMType.hs-boot
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/ForeignCall.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Name/Cache.hs
- compiler/GHC/Types/Name/Set.hs
- compiler/GHC/Types/Unique/DSet.hs
- compiler/GHC/Types/Var/Set.hs
- compiler/GHC/Unit/Module/ModIface.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/EndoOS.hs
- compiler/GHC/Utils/Ppr/Colour.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- + compiler/Language/Haskell/Syntax/Decls/Foreign.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/ghc.cabal.in
- configure.ac
- distrib/configure.ac.in
- docs/users_guide/9.16.1-notes.rst
- docs/users_guide/eventlog-formats.rst
- docs/users_guide/exts/explicit_namespaces.rst
- docs/users_guide/phases.rst
- docs/users_guide/using.rst
- ghc/GHCi/UI/Info.hs
- hadrian/src/Settings/Builders/RunTest.hs
- libraries/Cabal
- libraries/base/changelog.md
- libraries/base/src/Data/Bool.hs
- libraries/base/src/Data/Ix.hs
- libraries/base/src/Data/List.hs
- libraries/base/src/Data/List/NubOrdSet.hs
- libraries/base/src/GHC/Exts.hs
- libraries/deepseq
- libraries/directory
- libraries/exceptions
- libraries/ghc-experimental/CHANGELOG.md
- libraries/ghc-experimental/src/GHC/Stack/Annotation/Experimental.hs
- + libraries/ghc-experimental/tests/Makefile
- + libraries/ghc-experimental/tests/all.T
- + libraries/ghc-experimental/tests/backtraces/Makefile
- + libraries/ghc-experimental/tests/backtraces/T26806a.hs
- + libraries/ghc-experimental/tests/backtraces/T26806a.stderr
- + libraries/ghc-experimental/tests/backtraces/T26806b.hs
- + libraries/ghc-experimental/tests/backtraces/T26806b.stderr
- + libraries/ghc-experimental/tests/backtraces/T26806c.hs
- + libraries/ghc-experimental/tests/backtraces/T26806c.stderr
- + libraries/ghc-experimental/tests/backtraces/all.T
- libraries/ghc-internal/ghc-internal.cabal.in
- − libraries/ghc-internal/src/GHC/Internal/Data/Bool.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Foldable.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Function.hs
- − libraries/ghc-internal/src/GHC/Internal/Data/Ix.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Type/Bool.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Type/Ord.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Version.hs
- libraries/ghc-internal/src/GHC/Internal/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/Exts.hs
- libraries/ghc-internal/src/GHC/Internal/Heap/Closures.hs
- libraries/ghc-internal/src/GHC/Internal/IO/FD.hs
- libraries/ghc-internal/src/GHC/Internal/JS/Foreign/Callback.hs
- libraries/ghc-internal/src/GHC/Internal/JS/Prim.hs
- libraries/ghc-internal/src/GHC/Internal/JS/Prim/Internal/Build.hs
- libraries/ghc-internal/src/GHC/Internal/Magic.hs
- libraries/ghc-internal/src/GHC/Internal/STM.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Annotation.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- libraries/ghc-internal/src/GHC/Internal/System/IO/OS.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Lift.hs
- libraries/ghc-internal/src/GHC/Internal/Tuple.hs
- libraries/ghc-internal/src/GHC/Internal/TypeError.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Exports.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Imports.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Types.hs
- + libraries/ghc-internal/tests/backtraces/T15395.hs
- + libraries/ghc-internal/tests/backtraces/T15395.stdout
- libraries/ghc-internal/tests/backtraces/all.T
- libraries/ghc-internal/tests/stack-annotation/ann_frame001.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame002.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame003.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame004.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame005.stdout
- libraries/transformers
- m4/fp_cmm_cpp_cmd_with_args.m4
- m4/fptools_happy.m4
- rts/include/Stg.h
- rts/prim/atomic.c
- testsuite/driver/cpu_features.py
- − testsuite/driver/kill_extra_files.py
- testsuite/driver/testlib.py
- testsuite/mk/test.mk
- testsuite/tests/arrows/should_compile/T21301.stderr
- testsuite/tests/backpack/cabal/bkpcabal08/bkpcabal08.stdout
- testsuite/tests/codeGen/should_gen_asm/all.T
- + testsuite/tests/codeGen/should_gen_asm/avx512-int64-minmax.asm
- + testsuite/tests/codeGen/should_gen_asm/avx512-int64-minmax.hs
- + testsuite/tests/codeGen/should_gen_asm/avx512-int64-mul.asm
- + testsuite/tests/codeGen/should_gen_asm/avx512-int64-mul.hs
- + testsuite/tests/codeGen/should_gen_asm/avx512-word64-minmax.asm
- + testsuite/tests/codeGen/should_gen_asm/avx512-word64-minmax.hs
- testsuite/tests/codeGen/should_run/CgStaticPointers.hs
- testsuite/tests/codeGen/should_run/CgStaticPointersNoFullLazyness.hs
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/deSugar/should_fail/DsStrictFail.stderr
- testsuite/tests/deSugar/should_run/T20024.stderr
- testsuite/tests/deSugar/should_run/dsrun005.stderr
- testsuite/tests/deSugar/should_run/dsrun007.stderr
- testsuite/tests/deSugar/should_run/dsrun008.stderr
- testsuite/tests/deriving/should_run/T9576.stderr
- testsuite/tests/driver/T20030/test1/all.T
- testsuite/tests/driver/T20030/test2/all.T
- testsuite/tests/driver/T20030/test3/all.T
- testsuite/tests/driver/T20030/test4/all.T
- testsuite/tests/driver/T20030/test5/all.T
- testsuite/tests/driver/T20030/test6/all.T
- testsuite/tests/driver/T8526/T8526.script
- testsuite/tests/driver/bytecode-object/Makefile
- testsuite/tests/driver/bytecode-object/bytecode_object19.stdout
- testsuite/tests/driver/dynamicToo/dynamicToo001/Makefile
- testsuite/tests/driver/fat-iface/fat014.script
- testsuite/tests/driver/implicit-dyn-too/Makefile
- testsuite/tests/driver/multipleHomeUnits/all.T
- testsuite/tests/driver/multipleHomeUnits/multipleHomeUnits_recomp_th.stdout
- testsuite/tests/ffi/should_run/all.T
- testsuite/tests/ghci.debugger/scripts/T26042b.stdout
- testsuite/tests/ghci.debugger/scripts/T26042c.stdout
- testsuite/tests/ghci.debugger/scripts/T26042d2.stdout
- testsuite/tests/ghci.debugger/scripts/T26042f2.stdout
- − testsuite/tests/ghci/linking/T11531.stderr
- testsuite/tests/ghci/prog018/prog018.script
- testsuite/tests/ghci/scripts/Defer02.stderr
- testsuite/tests/ghci/scripts/T13869.script
- testsuite/tests/ghci/scripts/T13997.script
- testsuite/tests/ghci/scripts/T15325.stderr
- testsuite/tests/ghci/scripts/T17669.script
- testsuite/tests/ghci/scripts/T18330.script
- testsuite/tests/ghci/scripts/T18330.stdout
- testsuite/tests/ghci/scripts/T1914.script
- testsuite/tests/ghci/scripts/T20150.stdout
- testsuite/tests/ghci/scripts/T20217.script
- testsuite/tests/ghci/scripts/T6105.script
- testsuite/tests/ghci/scripts/T8042.script
- testsuite/tests/ghci/scripts/T8042recomp.script
- testsuite/tests/ghci/should_run/Makefile
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- testsuite/tests/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- testsuite/tests/linters/regex-linters/check-rts-includes.py
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/patsyn/should_run/ghci.stderr
- + testsuite/tests/plugins/T23110.hs
- + testsuite/tests/plugins/T23110.script
- + testsuite/tests/plugins/T23110.stdout
- testsuite/tests/plugins/all.T
- testsuite/tests/process/all.T
- testsuite/tests/quotes/LiftErrMsgDefer.stderr
- testsuite/tests/rename/should_fail/RnStaticPointersFail01.stderr
- testsuite/tests/rename/should_fail/RnStaticPointersFail03.stderr
- + testsuite/tests/rename/should_fail/T26545.hs
- + testsuite/tests/rename/should_fail/T26545.stderr
- testsuite/tests/rename/should_fail/all.T
- testsuite/tests/rts/T13676.script
- testsuite/tests/safeHaskell/safeLanguage/SafeLang15.stderr
- testsuite/tests/showIface/DocsInHiFile1.stdout
- testsuite/tests/showIface/HaddockSpanIssueT24378.stdout
- testsuite/tests/showIface/MagicHashInHaddocks.stdout
- testsuite/tests/simd/should_run/all.T
- testsuite/tests/simplCore/should_compile/T21391.hs
- + testsuite/tests/simplCore/should_compile/T26903.hs
- + testsuite/tests/simplCore/should_compile/T26903.stderr
- testsuite/tests/simplCore/should_compile/T8331.stderr
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/th/T26098A_quote.hs
- + testsuite/tests/th/T26098A_splice.hs
- + testsuite/tests/th/T26098_local.hs
- + testsuite/tests/th/T26098_local.stderr
- + testsuite/tests/th/T26098_quote.hs
- + testsuite/tests/th/T26098_quote.stderr
- + testsuite/tests/th/T26098_splice.hs
- + testsuite/tests/th/T26098_splice.stderr
- testsuite/tests/th/all.T
- testsuite/tests/type-data/should_run/T22332a.stderr
- + testsuite/tests/typecheck/should_compile/T24464.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_run/T10284.stderr
- testsuite/tests/typecheck/should_run/T13838.stderr
- + testsuite/tests/typecheck/should_run/T16981.hs
- + testsuite/tests/typecheck/should_run/T16981.stdout
- + testsuite/tests/typecheck/should_run/T24773.hs
- + testsuite/tests/typecheck/should_run/T24773.stdout
- testsuite/tests/typecheck/should_run/T9497a-run.stderr
- testsuite/tests/typecheck/should_run/T9497b-run.stderr
- testsuite/tests/typecheck/should_run/T9497c-run.stderr
- testsuite/tests/typecheck/should_run/all.T
- testsuite/tests/unsatisfiable/T23816.stderr
- testsuite/tests/unsatisfiable/UnsatDefer.stderr
- testsuite/tests/warnings/should_fail/CaretDiagnostics1.stderr
- utils/check-exact/ExactPrint.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cc.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cpp.hs
- utils/haddock/doc/.gitignore
- utils/haddock/doc/Makefile
- + utils/haddock/doc/_static/haddock-custom.css
- utils/haddock/doc/conf.py
- utils/haddock/doc/markup.rst
- + utils/haddock/doc/snippets/.gitignore
- + utils/haddock/doc/snippets/Lists.hs
- + utils/haddock/doc/snippets/Makefile
- + utils/haddock/doc/snippets/Snippet-List-Bulleted.html
- + utils/haddock/doc/snippets/Snippet-List-Bulleted.tex
- + utils/haddock/doc/snippets/Snippet-List-Definition.html
- + utils/haddock/doc/snippets/Snippet-List-Definition.tex
- + utils/haddock/doc/snippets/Snippet-List-Enumerated.html
- + utils/haddock/doc/snippets/Snippet-List-Enumerated.tex
- + utils/haddock/doc/snippets/Snippet-List-Indentation.html
- + utils/haddock/doc/snippets/Snippet-List-Indentation.tex
- + utils/haddock/doc/snippets/Snippet-List-Multiline-Item.html
- + utils/haddock/doc/snippets/Snippet-List-Multiline-Item.tex
- + utils/haddock/doc/snippets/Snippet-List-Nested-Item.html
- + utils/haddock/doc/snippets/Snippet-List-Nested-Item.tex
- + utils/haddock/doc/snippets/Snippet-List-Not-Newline.html
- + utils/haddock/doc/snippets/Snippet-List-Not-Newline.tex
- + utils/haddock/doc/snippets/Snippet-List-Not-Separated.html
- + utils/haddock/doc/snippets/Snippet-List-Not-Separated.tex
- utils/haddock/haddock-api/src/Haddock/Interface/LexParseRn.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- utils/haddock/html-test/ref/A.html
- utils/haddock/html-test/ref/Bug1004.html
- utils/haddock/html-test/ref/Bug1033.html
- utils/haddock/html-test/ref/Bug1103.html
- utils/haddock/html-test/ref/Bug548.html
- utils/haddock/html-test/ref/Bug923.html
- utils/haddock/html-test/ref/ConstructorPatternExport.html
- utils/haddock/html-test/ref/FunArgs.html
- utils/haddock/html-test/ref/Hash.html
- utils/haddock/html-test/ref/Instances.html
- utils/haddock/html-test/ref/LinearTypes.html
- utils/haddock/html-test/ref/RedactTypeSynonyms.html
- utils/haddock/html-test/ref/T23616.html
- utils/haddock/html-test/ref/Test.html
- utils/haddock/html-test/ref/TypeFamilies3.html
- utils/jsffi/dyld.mjs
- utils/jsffi/post-link.mjs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b4a7ad4eb590f51664872389616da3…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b4a7ad4eb590f51664872389616da3…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] docs: Fix grammar in explicit_namespaces.rst
by Marge Bot (@marge-bot) 20 Feb '26
by Marge Bot (@marge-bot) 20 Feb '26
20 Feb '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
fd9aaa28 by Simon Hengel at 2026-02-20T10:25:33-05:00
docs: Fix grammar in explicit_namespaces.rst
- - - - -
1 changed file:
- docs/users_guide/exts/explicit_namespaces.rst
Changes:
=====================================
docs/users_guide/exts/explicit_namespaces.rst
=====================================
@@ -86,7 +86,7 @@ However, how would one import only the data constructor? There are two options:
import Data.Proxy (data Proxy) -- imports the data constructor only
import Data.Proxy (pattern Proxy) -- imports the data constructor only
-The ``data`` keyword enables the import or export a data constructor without its
+The ``data`` keyword allows a data constructor to be imported or exported without its
parent type constructor.
The ``pattern`` keyword does the same, with only a few differences:
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fd9aaa283970926d76688a5056d3942…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fd9aaa283970926d76688a5056d3942…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] Add optional `SrcLoc` to `StackAnnotation` class
by Marge Bot (@marge-bot) 20 Feb '26
by Marge Bot (@marge-bot) 20 Feb '26
20 Feb '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
4c40df3d by fendor at 2026-02-20T10:24:48-05:00
Add optional `SrcLoc` to `StackAnnotation` class
`StackAnnotation`s give access to an optional `SrcLoc` field that
user-added stack annotations can use to provide better backtraces in both error
messages and when decoding the callstack.
We update builtin stack annotations such as `StringAnnotation` and
`ShowAnnotation` to also capture the `SrcLoc` of the current `CallStack`
to improve backtraces by default (if stack annotations are used).
This change is backwards compatible with GHC 9.14.1.
- - - - -
20 changed files:
- libraries/ghc-experimental/CHANGELOG.md
- libraries/ghc-experimental/src/GHC/Stack/Annotation/Experimental.hs
- + libraries/ghc-experimental/tests/Makefile
- + libraries/ghc-experimental/tests/all.T
- + libraries/ghc-experimental/tests/backtraces/Makefile
- + libraries/ghc-experimental/tests/backtraces/T26806a.hs
- + libraries/ghc-experimental/tests/backtraces/T26806a.stderr
- + libraries/ghc-experimental/tests/backtraces/T26806b.hs
- + libraries/ghc-experimental/tests/backtraces/T26806b.stderr
- + libraries/ghc-experimental/tests/backtraces/T26806c.hs
- + libraries/ghc-experimental/tests/backtraces/T26806c.stderr
- + libraries/ghc-experimental/tests/backtraces/all.T
- libraries/ghc-internal/src/GHC/Internal/Stack/Annotation.hs
- libraries/ghc-internal/tests/stack-annotation/ann_frame001.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame002.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame003.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame004.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame005.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
Changes:
=====================================
libraries/ghc-experimental/CHANGELOG.md
=====================================
@@ -5,12 +5,17 @@
- New and/or/xor SIMD primops for bitwise logical operations, such as andDoubleX4#, orWord32X4#, xorInt8X16#, etc.
These are supported by the LLVM backend and by the X86_64 NCG backend (for the latter, only for 128-wide vectors).
-## ghc-experimental-9.1401.0,
+## ghc-experimental-9.1402.0
+
+- Add optional `SrcLoc` to `StackAnnotation` class in `GHC.Stack.Annotation.Experimental`
+
+## ghc-experimental-9.1401.0
- Expose access to RTS flags via `GHC.RTS.Flags.Experimental`
- Expose access to era profiling interface via `GHC.Profiling.Eras`
- Expose access to runtime stack annotations via `GHC.Stack.Annotation.Experimental`
- Expose custom allocation limit handler via `System.Mem.Experimental`
+- Expose access to Stack Annotations via `GHC.Stack.Annotation.Experimental`
- Expose module Prelude.Experimental, which reexports some modules from ghc-experimental for convenience, like Prelude does for base.
## ghc-experimental-9.1201.0
=====================================
libraries/ghc-experimental/src/GHC/Stack/Annotation/Experimental.hs
=====================================
@@ -82,9 +82,6 @@ import GHC.Internal.Stack.Annotation
-- the pure variations can behave in ways that are hard to predict.
--
-- See Note [Stack annotations in pure code] for more details.
---
--- At last, stack annotations are tricky to use with 'error'.
--- See Note [Pushing annotation frames on 'error'] for why this is the case.
-- Note [Stack annotations in pure code]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -96,57 +93,50 @@ import GHC.Internal.Stack.Annotation
-- For example:
--
-- @
--- annotateStackShow (5 @Int) (fib 20 + throw (ErrorCall "Oh no!"))
+-- annotateStackShow (5 @Int) (fib 20 + error "Oh no!")
-- @
--
--- Without forcing the result of @(fib 20 + throw (ErrorCall "Oh no!"))@, the computation
+-- Without forcing the result of @(fib 20 + error "Oh no!")@, the computation
-- will simply return a thunk, and the stack annotation would be popped off the stack.
-- Once the thunk is evaluated, the exception is raised, but no stack annotation will be found!
--- If we force the result of @(fib 20 + throw (ErrorCall "Oh no!"))@, then the stack
+-- If we force the result of @(fib 20 + error "Oh no!")@, then the stack
-- annotations remain on the stack, and are displayed in the stack trace.
--
-- Naturally, this only holds if no imprecise exceptions are thrown during evaluation of any
-- nested value, for example in 'annotateStackShow 5 (Just $ throw (ErrorCall "Oh no!"))', the
-- stack trace will not include the value @5@.
--
--- See how we preferred @throw (ErrorCall ...)@ over @error@?
--- See Note [Pushing annotation frames on 'error'] for why we do this.
-
--- Note [Pushing annotation frames on 'error']
--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- Examples so far have not been using 'error' at all.
--- The reason is that 'error' is extraordinarily difficult to use correctly with stack annotation frames.
--- See Note [Capturing the backtrace in throw] for a detailed discussion of how 'throw'
--- manages to capture 'Backtraces'.
---
--- Long story short, 'error' does not do the same thing as 'throw' and is subtly different
--- in terms of evaluation, cause it to bypass the stack annotation frames, especially in
--- pure code.
---
--- However, even in 'IO' code, it is difficult to use 'error' and obtain stack annotation frames
--- close to the call site due to the same issue of laziness and backtrace collection.
---
--- This means, right now, if you want to reliably capture stack frame annotations,
--- in both pure and impure code, prefer 'throw' and 'throwIO' variants over 'error'.
-- ----------------------------------------------------------------------------
-- Annotations
-- ----------------------------------------------------------------------------
+
+-- | A 'String' only annotation with an optional source location.
data StringAnnotation where
- StringAnnotation :: String -> StringAnnotation
+ StringAnnotation :: !(Maybe SrcLoc) -> String -> StringAnnotation
instance StackAnnotation StringAnnotation where
- displayStackAnnotation (StringAnnotation str) = str
+ displayStackAnnotationShort (StringAnnotation _srcLoc str) =
+ str
+
+ stackAnnotationSourceLocation (StringAnnotation srcLoc _str) =
+ srcLoc
-- | Use the 'Show' instance of a type to display as the 'StackAnnotation'.
data ShowAnnotation where
- ShowAnnotation :: forall a . Show a => a -> ShowAnnotation
+ ShowAnnotation :: forall a . Show a => !(Maybe SrcLoc) -> a -> ShowAnnotation
instance StackAnnotation ShowAnnotation where
- displayStackAnnotation (ShowAnnotation showAnno) = show showAnno
+ displayStackAnnotationShort (ShowAnnotation _srcLoc showAnno) =
+ show showAnno
+
+ stackAnnotationSourceLocation (ShowAnnotation srcLoc _showAnno) =
+ srcLoc
-- | A 'CallStack' stack annotation.
+--
+-- Captures the whole 'CallStack'.
newtype CallStackAnnotation = CallStackAnnotation CallStack
instance Show CallStackAnnotation where
@@ -154,9 +144,23 @@ instance Show CallStackAnnotation where
-- | Displays the first entry of the 'CallStack'
instance StackAnnotation CallStackAnnotation where
- displayStackAnnotation (CallStackAnnotation cs) = case getCallStack cs of
+ stackAnnotationSourceLocation (CallStackAnnotation cs) =
+ callStackHeadSrcLoc cs
+
+ displayStackAnnotationShort (CallStackAnnotation cs) =
+ callStackHeadFunctionName cs
+
+callStackHeadSrcLoc :: CallStack -> Maybe SrcLoc
+callStackHeadSrcLoc cs =
+ case getCallStack cs of
+ [] -> Nothing
+ (_, srcLoc):_ -> Just srcLoc
+
+callStackHeadFunctionName :: CallStack -> String
+callStackHeadFunctionName cs =
+ case getCallStack cs of
[] -> "<unknown source location>"
- ((fnName,srcLoc):_) -> fnName ++ ", called at " ++ prettySrcLoc srcLoc
+ (fnName, _):_ -> fnName
-- ----------------------------------------------------------------------------
-- Annotate the CallStack with custom data
@@ -172,7 +176,7 @@ instance StackAnnotation CallStackAnnotation where
--
-- WARNING: forces the evaluation of @b@ to WHNF.
{-# NOINLINE annotateStack #-}
-annotateStack :: forall a b. (Typeable a, StackAnnotation a) => a -> b -> b
+annotateStack :: forall a b. (HasCallStack, Typeable a, StackAnnotation a) => a -> b -> b
annotateStack ann b = unsafePerformIO $
annotateStackIO ann (evaluate b)
@@ -196,9 +200,9 @@ annotateCallStack b = unsafePerformIO $ withFrozenCallStack $
-- information to stack traces.
--
-- WARNING: forces the evaluation of @b@ to WHNF.
-annotateStackString :: forall b . String -> b -> b
+annotateStackString :: forall b . HasCallStack => String -> b -> b
annotateStackString ann =
- annotateStack (StringAnnotation ann)
+ annotateStack (StringAnnotation (callStackHeadSrcLoc ?callStack) ann)
-- | @'annotateStackShow' showable b@ annotates the evaluation stack of @b@
-- with the value @showable@.
@@ -207,37 +211,36 @@ annotateStackString ann =
-- information to stack traces.
--
-- WARNING: forces the evaluation of @b@ to WHNF.
-annotateStackShow :: forall a b . (Typeable a, Show a) => a -> b -> b
+annotateStackShow :: forall a b . (HasCallStack, Typeable a, Show a) => a -> b -> b
annotateStackShow ann =
- annotateStack (ShowAnnotation ann)
+ annotateStack (ShowAnnotation (callStackHeadSrcLoc ?callStack) ann)
-- | @'annotateStackIO' showable b@ annotates the evaluation stack of @b@
-- with the value @showable@.
--
-- When decoding the call stack, the annotation frames can be used to add more
-- information to stack traces.
-annotateStackIO :: forall a b . (Typeable a, StackAnnotation a) => a -> IO b -> IO b
+annotateStackIO :: forall a b . (HasCallStack, Typeable a, StackAnnotation a) => a -> IO b -> IO b
annotateStackIO ann (IO act) =
IO $ \s -> annotateStack# (SomeStackAnnotation ann) act s
-{-# NOINLINE annotateStackIO #-}
-- | @'annotateStackStringIO' msg b@ annotates the evaluation stack of @b@
-- with the value @msg@.
--
-- When decoding the call stack, the annotation frames can be used to add more
-- information to stack traces.
-annotateStackStringIO :: forall b . String -> IO b -> IO b
+annotateStackStringIO :: forall b . HasCallStack => String -> IO b -> IO b
annotateStackStringIO ann =
- annotateStackIO (StringAnnotation ann)
+ annotateStackIO (StringAnnotation (callStackHeadSrcLoc ?callStack) ann)
-- | @'annotateStackShowIO' msg b@ annotates the evaluation stack of @b@
-- with the value @msg@.
--
-- When decoding the call stack, the annotation frames can be used to add more
-- information to stack traces.
-annotateStackShowIO :: forall a b . (Show a) => a -> IO b -> IO b
+annotateStackShowIO :: forall a b . (HasCallStack, Show a) => a -> IO b -> IO b
annotateStackShowIO ann =
- annotateStackIO (ShowAnnotation ann)
+ annotateStackIO (ShowAnnotation (callStackHeadSrcLoc ?callStack) ann)
-- | @'annotateCallStackIO' b@ annotates the evaluation stack of @b@ with the
-- current 'callstack'.
=====================================
libraries/ghc-experimental/tests/Makefile
=====================================
@@ -0,0 +1,7 @@
+# This Makefile runs the tests using GHC's testsuite framework. It
+# assumes the package is part of a GHC build tree with the testsuite
+# installed in ../../../testsuite.
+
+TOP=../../../testsuite
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
=====================================
libraries/ghc-experimental/tests/all.T
=====================================
=====================================
libraries/ghc-experimental/tests/backtraces/Makefile
=====================================
@@ -0,0 +1,7 @@
+# This Makefile runs the tests using GHC's testsuite framework. It
+# assumes the package is part of a GHC build tree with the testsuite
+# installed in ../../../testsuite.
+
+TOP=../../../../testsuite
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
=====================================
libraries/ghc-experimental/tests/backtraces/T26806a.hs
=====================================
@@ -0,0 +1,14 @@
+module Main where
+
+import GHC.Stack.Annotation.Experimental
+import Control.Exception
+import Control.Exception.Backtrace
+
+main :: IO ()
+main = do
+ setBacktraceMechanismState IPEBacktrace True
+ annotateCallStackIO $ do
+ annotateStackShowIO ([1..4] :: [Int]) $ do
+ annotateStackStringIO "Lovely annotation" $ do
+ throwIO $ ErrorCall "Backtrace Test"
+
=====================================
libraries/ghc-experimental/tests/backtraces/T26806a.stderr
=====================================
@@ -0,0 +1,11 @@
+T26806a: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+Backtrace Test
+
+IPE backtrace:
+ Lovely annotation, called at T26806a.hs:12:7 in main:Main
+ [1,2,3,4], called at T26806a.hs:11:5 in main:Main
+ annotateCallStackIO, called at T26806a.hs:10:3 in main:Main
+HasCallStack backtrace:
+ throwIO, called at T26806a.hs:13:9 in main:Main
+
=====================================
libraries/ghc-experimental/tests/backtraces/T26806b.hs
=====================================
@@ -0,0 +1,18 @@
+module Main where
+
+import GHC.Stack.Annotation.Experimental
+import Control.Exception
+import Control.Exception.Backtrace
+
+main :: IO ()
+main = do
+ setBacktraceMechanismState IPEBacktrace True
+ print $ foo 500
+
+foo :: Int -> Int
+foo n =
+ annotateCallStack $
+ annotateStackShow ([1..4] :: [Int]) $
+ annotateStackString "Lovely annotation" $
+ throw $ ErrorCall $ "Backtrace Test: " ++ show (n * n * n)
+
=====================================
libraries/ghc-experimental/tests/backtraces/T26806b.stderr
=====================================
@@ -0,0 +1,10 @@
+T26806b: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+Backtrace Test: 125000000
+
+IPE backtrace:
+ Lovely annotation, called at T26806b.hs:16:7 in main:Main
+ [1,2,3,4], called at T26806b.hs:15:5 in main:Main
+ annotateCallStack, called at T26806b.hs:14:3 in main:Main
+HasCallStack backtrace:
+ throw, called at T26806b.hs:17:9 in main:Main
=====================================
libraries/ghc-experimental/tests/backtraces/T26806c.hs
=====================================
@@ -0,0 +1,18 @@
+module Main where
+
+import GHC.Stack.Annotation.Experimental
+import Control.Exception
+import Control.Exception.Backtrace
+
+main :: IO ()
+main = do
+ setBacktraceMechanismState IPEBacktrace True
+ print $ foo 500
+
+foo :: Int -> Int
+foo n =
+ annotateCallStack $
+ annotateStackShow ([1..4] :: [Int]) $
+ annotateStackString "Lovely annotation" $
+ error $ "Backtrace Test: " ++ show (n * n * n)
+
=====================================
libraries/ghc-experimental/tests/backtraces/T26806c.stderr
=====================================
@@ -0,0 +1,11 @@
+T26806c: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+Backtrace Test: 125000000
+
+IPE backtrace:
+ Lovely annotation, called at T26806c.hs:16:7 in main:Main
+ [1,2,3,4], called at T26806c.hs:15:5 in main:Main
+ annotateCallStack, called at T26806c.hs:14:3 in main:Main
+HasCallStack backtrace:
+ error, called at T26806c.hs:17:9 in main:Main
+
=====================================
libraries/ghc-experimental/tests/backtraces/all.T
=====================================
@@ -0,0 +1,5 @@
+stack_annotation_backtrace_opts = [ when(have_profiling(), extra_ways(['prof'])) , when(js_arch(), skip) , exit_code(1) ]
+
+test('T26806a', stack_annotation_backtrace_opts, compile_and_run, [''])
+test('T26806b', stack_annotation_backtrace_opts, compile_and_run, [''])
+test('T26806c', stack_annotation_backtrace_opts, compile_and_run, [''])
=====================================
libraries/ghc-internal/src/GHC/Internal/Stack/Annotation.hs
=====================================
@@ -4,6 +4,7 @@ module GHC.Internal.Stack.Annotation where
import GHC.Internal.Base
import GHC.Internal.Data.Typeable
+import GHC.Internal.Stack (SrcLoc, prettySrcLoc)
-- ----------------------------------------------------------------------------
-- StackAnnotation
@@ -13,8 +14,38 @@ import GHC.Internal.Data.Typeable
-- as the payload of 'AnnFrame' stack frames.
--
class StackAnnotation a where
+ -- | Display a human readable string for the 'StackAnnotation'.
+ --
+ -- This is supposed to be the long version of 'displayStackAnnotationShort'
+ -- and may contain a source location.
+ --
+ -- If not provided, 'displayStackAnnotation' is derived from 'stackAnnotationSourceLocation'
+ -- and 'displayStackAnnotationShort'.
displayStackAnnotation :: a -> String
+ -- | Get the 'SrcLoc' of the given 'StackAnnotation'.
+ --
+ -- This is optional, 'SrcLoc' are not strictly required for 'StackAnnotation', but
+ -- it is still heavily encouarged to provide a 'SrcLoc' for better IPE backtraces.
+ stackAnnotationSourceLocation :: a -> Maybe SrcLoc
+
+ -- | The description of the StackAnnotation without any metadata such as source locations.
+ --
+ -- Pefer implementing 'displayStackAnnotationShort' over 'displayStackAnnotation'.
+ displayStackAnnotationShort :: a -> String
+
+ {-# MINIMAL displayStackAnnotation | displayStackAnnotationShort #-}
+
+ displayStackAnnotation ann =
+ displayStackAnnotationShort ann
+ ++ case stackAnnotationSourceLocation ann of
+ Nothing -> ""
+ Just srcLoc -> ", called at " ++ prettySrcLoc srcLoc
+
+ stackAnnotationSourceLocation _ann = Nothing
+
+ displayStackAnnotationShort = displayStackAnnotation
+
-- ----------------------------------------------------------------------------
-- Annotations
-- ----------------------------------------------------------------------------
@@ -28,4 +59,11 @@ data SomeStackAnnotation where
SomeStackAnnotation :: forall a. (Typeable a, StackAnnotation a) => a -> SomeStackAnnotation
instance StackAnnotation SomeStackAnnotation where
- displayStackAnnotation (SomeStackAnnotation a) = displayStackAnnotation a
+ displayStackAnnotation (SomeStackAnnotation a) =
+ displayStackAnnotation a
+
+ stackAnnotationSourceLocation (SomeStackAnnotation a) =
+ stackAnnotationSourceLocation a
+
+ displayStackAnnotationShort (SomeStackAnnotation a) =
+ displayStackAnnotationShort a
=====================================
libraries/ghc-internal/tests/stack-annotation/ann_frame001.stdout
=====================================
@@ -1,12 +1,12 @@
Stack annotations:
-- (2,3)
+- (2,3), called at ann_frame001.hs:5:13 in main:Main
47
Stack annotations:
-- "bar"
-- "foo"
-- "tailCallEx"
+- "bar", called at ann_frame001.hs:23:9 in main:Main
+- "foo", called at ann_frame001.hs:21:11 in main:Main
+- "tailCallEx", called at ann_frame001.hs:17:18 in main:Main
Stack annotations:
-- "bar"
-- "foo"
-- "tailCallEx"
+- "bar", called at ann_frame001.hs:23:9 in main:Main
+- "foo", called at ann_frame001.hs:21:11 in main:Main
+- "tailCallEx", called at ann_frame001.hs:17:18 in main:Main
40
=====================================
libraries/ghc-internal/tests/stack-annotation/ann_frame002.stdout
=====================================
@@ -7,5 +7,5 @@ Finish some work
Some more work in bar
17711
Stack annotations:
-- bar
+- bar, called at ann_frame002.hs:23:29 in main:Main
- annotateCallStackIO, called at ann_frame002.hs:23:7 in main:Main
=====================================
libraries/ghc-internal/tests/stack-annotation/ann_frame003.stdout
=====================================
@@ -1,6 +1,6 @@
47
Stack annotations:
-- "bar"
-- "foo"
-- "tailCallEx"
+- "bar", called at ann_frame003.hs:25:9 in main:Main
+- "foo", called at ann_frame003.hs:21:11 in main:Main
+- "tailCallEx", called at ann_frame003.hs:16:18 in main:Main
40
=====================================
libraries/ghc-internal/tests/stack-annotation/ann_frame004.stdout
=====================================
@@ -13,5 +13,5 @@ Stack annotations:
- annotateCallStack, called at ann_frame004.hs:21:17 in main:Main
- annotateCallStack, called at ann_frame004.hs:21:17 in main:Main
- annotateCallStack, called at ann_frame004.hs:13:10 in main:Main
-- bar
+- bar, called at ann_frame004.hs:12:29 in main:Main
- annotateCallStackIO, called at ann_frame004.hs:12:7 in main:Main
=====================================
libraries/ghc-internal/tests/stack-annotation/ann_frame005.stdout
=====================================
@@ -2,9 +2,9 @@
Caught exception: SimpleBoom
Exception context:
- IPE backtrace:
-- throwIO SimpleBoom
-- raising action
-- catch site for throwIO SimpleBoom
+- throwIO SimpleBoom, called at ann_frame005.hs:33:5 in main:Main
+- raising action, called at ann_frame005.hs:32:3 in main:Main
+- catch site for throwIO SimpleBoom, called at ann_frame005.hs:27:5 in main:Main
- annotateCallStackIO, called at ann_frame005.hs:26:3 in main:Main
- HasCallStack backtrace:
- throwIO, called at ann_frame005.hs:34:7 in main:Main
@@ -13,9 +13,9 @@ Handler annotation not present in context
Caught exception: Prelude.undefined
Exception context:
- IPE backtrace:
-- undefined thunk
-- raising undefined action
-- catch site for undefined
+- undefined thunk, called at ann_frame005.hs:41:9 in main:Main
+- raising undefined action, called at ann_frame005.hs:38:3 in main:Main
+- catch site for undefined, called at ann_frame005.hs:27:5 in main:Main
- annotateCallStackIO, called at ann_frame005.hs:26:3 in main:Main
- HasCallStack backtrace:
- undefined, called at ann_frame005.hs:41:48 in main:Main
@@ -24,9 +24,9 @@ Handler annotation not present in context
Caught exception: error from annotateStackString
Exception context:
- IPE backtrace:
-- error thunk
-- raising error action
-- catch site for error
+- error thunk, called at ann_frame005.hs:48:9 in main:Main
+- raising error action, called at ann_frame005.hs:45:3 in main:Main
+- catch site for error, called at ann_frame005.hs:27:5 in main:Main
- annotateCallStackIO, called at ann_frame005.hs:26:3 in main:Main
- HasCallStack backtrace:
- error, called at ann_frame005.hs:48:44 in main:Main
@@ -35,8 +35,8 @@ Handler annotation not present in context
Caught exception: SimpleBoom
Exception context:
- IPE backtrace:
-- raising throwSTM action
-- catch site for throwSTM
+- raising throwSTM action, called at ann_frame005.hs:52:3 in main:Main
+- catch site for throwSTM, called at ann_frame005.hs:27:5 in main:Main
- annotateCallStackIO, called at ann_frame005.hs:26:3 in main:Main
- HasCallStack backtrace:
- throwSTM, called at ann_frame005.hs:55:9 in main:Main
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout
=====================================
@@ -6499,25 +6499,27 @@ module GHC.Stack.Annotation.Experimental where
newtype CallStackAnnotation = CallStackAnnotation GHC.Internal.Stack.Types.CallStack
type ShowAnnotation :: *
data ShowAnnotation where
- ShowAnnotation :: forall a. GHC.Internal.Show.Show a => a -> ShowAnnotation
+ ShowAnnotation :: forall a. GHC.Internal.Show.Show a => !(GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc) -> a -> ShowAnnotation
type SomeStackAnnotation :: *
data SomeStackAnnotation where
SomeStackAnnotation :: forall a. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> SomeStackAnnotation
type StackAnnotation :: * -> Constraint
class StackAnnotation a where
displayStackAnnotation :: a -> GHC.Internal.Base.String
- {-# MINIMAL displayStackAnnotation #-}
+ stackAnnotationSourceLocation :: a -> GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc
+ displayStackAnnotationShort :: a -> GHC.Internal.Base.String
+ {-# MINIMAL displayStackAnnotation | displayStackAnnotationShort #-}
type StringAnnotation :: *
data StringAnnotation where
- StringAnnotation :: GHC.Internal.Base.String -> StringAnnotation
+ StringAnnotation :: !(GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc) -> GHC.Internal.Base.String -> StringAnnotation
annotateCallStack :: forall b. GHC.Internal.Stack.Types.HasCallStack => b -> b
annotateCallStackIO :: forall a. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Types.IO a -> GHC.Internal.Types.IO a
- annotateStack :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> b -> b
- annotateStackIO :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
- annotateStackShow :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Show.Show a) => a -> b -> b
- annotateStackShowIO :: forall a b. GHC.Internal.Show.Show a => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
- annotateStackString :: forall b. GHC.Internal.Base.String -> b -> b
- annotateStackStringIO :: forall b. GHC.Internal.Base.String -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStack :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> b -> b
+ annotateStackIO :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStackShow :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Show.Show a) => a -> b -> b
+ annotateStackShowIO :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, GHC.Internal.Show.Show a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStackString :: forall b. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Base.String -> b -> b
+ annotateStackStringIO :: forall b. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Base.String -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
module GHC.Stats.Experimental where
-- Safety: Safe
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
=====================================
@@ -6502,25 +6502,27 @@ module GHC.Stack.Annotation.Experimental where
newtype CallStackAnnotation = CallStackAnnotation GHC.Internal.Stack.Types.CallStack
type ShowAnnotation :: *
data ShowAnnotation where
- ShowAnnotation :: forall a. GHC.Internal.Show.Show a => a -> ShowAnnotation
+ ShowAnnotation :: forall a. GHC.Internal.Show.Show a => !(GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc) -> a -> ShowAnnotation
type SomeStackAnnotation :: *
data SomeStackAnnotation where
SomeStackAnnotation :: forall a. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> SomeStackAnnotation
type StackAnnotation :: * -> Constraint
class StackAnnotation a where
displayStackAnnotation :: a -> GHC.Internal.Base.String
- {-# MINIMAL displayStackAnnotation #-}
+ stackAnnotationSourceLocation :: a -> GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc
+ displayStackAnnotationShort :: a -> GHC.Internal.Base.String
+ {-# MINIMAL displayStackAnnotation | displayStackAnnotationShort #-}
type StringAnnotation :: *
data StringAnnotation where
- StringAnnotation :: GHC.Internal.Base.String -> StringAnnotation
+ StringAnnotation :: !(GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.SrcLoc) -> GHC.Internal.Base.String -> StringAnnotation
annotateCallStack :: forall b. GHC.Internal.Stack.Types.HasCallStack => b -> b
annotateCallStackIO :: forall a. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Types.IO a -> GHC.Internal.Types.IO a
- annotateStack :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> b -> b
- annotateStackIO :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
- annotateStackShow :: forall a b. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Show.Show a) => a -> b -> b
- annotateStackShowIO :: forall a b. GHC.Internal.Show.Show a => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
- annotateStackString :: forall b. GHC.Internal.Base.String -> b -> b
- annotateStackStringIO :: forall b. GHC.Internal.Base.String -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStack :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> b -> b
+ annotateStackIO :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, StackAnnotation a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStackShow :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Show.Show a) => a -> b -> b
+ annotateStackShowIO :: forall a b. (GHC.Internal.Stack.Types.HasCallStack, GHC.Internal.Show.Show a) => a -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
+ annotateStackString :: forall b. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Base.String -> b -> b
+ annotateStackStringIO :: forall b. GHC.Internal.Stack.Types.HasCallStack => GHC.Internal.Base.String -> GHC.Internal.Types.IO b -> GHC.Internal.Types.IO b
module GHC.Stats.Experimental where
-- Safety: Safe
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4c40df3df7e806e6e21259fa51d872c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4c40df3df7e806e6e21259fa51d872c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/andreask/hadrian_race] Apply 5 suggestion(s) to 2 file(s)
by Andreas Klebinger (@AndreasK) 20 Feb '26
by Andreas Klebinger (@AndreasK) 20 Feb '26
20 Feb '26
Andreas Klebinger pushed to branch wip/andreask/hadrian_race at Glasgow Haskell Compiler / GHC
Commits:
20a0c08f by Andreas Klebinger at 2026-02-20T13:51:25+00:00
Apply 5 suggestion(s) to 2 file(s)
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
- - - - -
2 changed files:
- libraries/ghc-boot/GHC/Unit/Database.hs
- utils/ghc-pkg/Main.hs
Changes:
=====================================
libraries/ghc-boot/GHC/Unit/Database.hs
=====================================
@@ -317,17 +317,29 @@ data DbInstUnitId
-- | Represents a lock of a package db.
newtype PackageDbLock = PackageDbLock Handle
--- | Run the action under a lock, then return the result.
--- If the mode is R/W the *caller* needs to either free the lock or pass it
--- on to code that will.
+-- | Take a lock on the package database and then run the action.
--
--- If an exception is raised the lock is released.
+-- - In read-only mode, this takes and releases a shared lock.
+-- - In read-write mode, this takes an exclusive lock, and the caller
+-- must arrange for this lock to be released:
+--
+-- - either the inner action releases it, or
+-- - the inner action returns the lock and the caller
+-- of 'withLockedPackageDb' is responsible for releasing it.
+--
+-- If an exception escapes the inner action, the lock is released.
+--
+-- See Note [ghc-pkg database locking] in ghc-pkg/Main.hs
withLockedPackageDb :: DbOpenMode m t -> FilePath -> (PackageDbLock -> IO a) -> IO a
-withLockedPackageDb mode file act = do
- lock <- lockPackageDbWith (lock_mode mode) file
- r <- act lock `onException` unlockPackageDb lock
- when (isDbOpenReadMode mode ) $ unlockPackageDb lock
- pure r
+withLockedPackageDb mode file =
+ bracket_for_mode
+ (lockPackageDbWith (lock_mode mode) file)
+ unlockPackageDb
+ where
+ bracket_for_mode =
+ case mode of
+ DbOpenReadOnly -> bracket
+ DbOpenReadWrite -> bracketOnError
where
lock_mode :: DbOpenMode m t -> LockMode
lock_mode DbOpenReadOnly = SharedLock
@@ -529,8 +541,8 @@ headerMagic = BS.Char8.pack "\0ghcpkg\0"
-- | Feed a 'Get' decoder with data chunks from a file.
--
--- The file is already locked when we call this. We only need to pass it on
--- if we are in R/W mode.
+-- Requires a lock (either shared or exclusive) on the package database,
+-- which it returns unchanged.
decodeFromFile :: FilePath -> DbOpenMode mode PackageDbLock -> Get pkgs ->
IO (pkgs, DbOpenMode mode PackageDbLock)
decodeFromFile file mode decoder = case mode of
=====================================
utils/ghc-pkg/Main.hs
=====================================
@@ -875,31 +875,30 @@ lookForPackageDBIn dir = do
{- Note [ghc-pkg database locking]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-It's important for ghc-pkg, GHC and hadrian to always see a consistent state for
-package databases. To ensure this we generally tacke a lock both for reading and
-writing to the package database.
-
-The general idea is we use `withLockedPackageDb` to lock an already existing
-database in both modes. Which behaves differently for reads and modify.
-
-In read mode we take a shared lock before we start reading, run the argument to
-withLockedPackageDb and simply unlock the DB after. We need to lock it to avoid
-concurrent invocations from deleting files from the db before we managed to read
-them. This occasionally happened in #22870. Not that historically we only used
-to lock the package db during reads on windows, for reasons that seem to have been
-bogus given the existence of #22870. And it was partially discussed in #16773.
-
-When modifying a package database we also use withLockedPackageDb but we take
-an *exclusive* lock and most importantly we don't unlock the DB after the action
-has run unless an exception occurs.
-Instead the action we are must ensure the lock is either freed, or returned
-as part of the result to be freed later by the caller of withLockedPackageDB.
-Typically by storing it inside either a `DbOpenMode` or `PackageDB`.
-
-While this setup is a bit cumbersome it seemed to be the easiest way to ensure
+It's important for ghc-pkg, GHC and Hadrian to always see a consistent state for
+package databases. To ensure this, we always take a lock before reading or writing
+to a package database.
+
+The general idea is we use 'withLockedPackageDb' to lock an already existing
+database in both modes:
+
+ - In read-only mode, we take a *shared* lock before reading and unlock afterwards.
+ Locking is needed to avoid a concurrent invocation of ghc-pkg deleting files from
+ the db before we manage to read them. This occasionally happened in #22870.
+ (Note that, historically, we used to only lock the package db during reads on
+ Windows, but the justification seemed insufficient given #22870. See also #16773.)
+
+ - In read-write mode, we take an **exclusive** lock on the package database.
+ However, we don't automatically release the lock after the inner action completes
+ (unless an exception occurs). Instead, either the inner action itself releases the
+ lock, or it returns it, in which case it is the caller of 'withLockedPackageDb'
+ that is responsible for releasing the lock. Typically, the exclusive lock is stored
+ in 'PackageDB', with the type informing us that we have a lock we are responsible for
+ releasing. 'updateDBCache' eventually releases it.
+
+While this setup is a bit cumbersome, it seemed to be the easiest way to ensure
that locks are consistently held over reads/modifications of a database without
engaging in a larger refactor of the ghc-pkg code.
-
-}
readParseDatabase :: forall mode t. Verbosity
-> Maybe (FilePath,Bool)
@@ -923,7 +922,7 @@ readParseDatabase verbosity mb_user_conf mode use_cache path
-- Take a lock to use while we read the DB
Right fs -> withLockedPackageDb mode cache $ \lock -> do
if not use_cache
- then ignore_cache (lock) (const $ return ())
+ then ignore_cache lock (const $ return ())
else do
e_tcache <- tryIO $ getModificationTime cache
case e_tcache of
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/20a0c08f1125e0315d75163dce5155f…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/20a0c08f1125e0315d75163dce5155f…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Teo Camarasu pushed to branch wip/T26930 at Glasgow Haskell Compiler / GHC
Commits:
7c937f7d by Teo Camarasu at 2026-02-20T12:21:34+00:00
Float up generics
- - - - -
20 changed files:
- libraries/ghc-internal/src/GHC/Internal/ByteOrder.hs
- − libraries/ghc-internal/src/GHC/Internal/ByteOrder.hs-boot
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Foldable.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Functor/Const.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Monoid.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Semigroup/Internal.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Traversable.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Version.hs
- libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
- libraries/ghc-internal/src/GHC/Internal/Generics.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/RTS/Flags.hsc
- libraries/ghc-internal/src/GHC/Internal/Read.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Bits.hs
- testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
- testsuite/tests/ghci/scripts/T10963.stderr
- testsuite/tests/ghci/scripts/ghci064.stdout
- testsuite/tests/interface-stability/base-exports.stdout
Changes:
=====================================
libraries/ghc-internal/src/GHC/Internal/ByteOrder.hs
=====================================
@@ -27,8 +27,6 @@ module GHC.Internal.ByteOrder
import GHC.Internal.Base
import GHC.Internal.Enum
-import GHC.Internal.Generics (Generic)
-import GHC.Internal.Text.Read
import GHC.Internal.Text.Show
-- | Byte ordering.
@@ -39,9 +37,7 @@ data ByteOrder
, Ord -- ^ @since base-4.11.0.0
, Bounded -- ^ @since base-4.11.0.0
, Enum -- ^ @since base-4.11.0.0
- , Read -- ^ @since base-4.11.0.0
, Show -- ^ @since base-4.11.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | The byte ordering of the target machine.
=====================================
libraries/ghc-internal/src/GHC/Internal/ByteOrder.hs-boot deleted
=====================================
@@ -1,29 +0,0 @@
-{-# LANGUAGE NoImplicitPrelude #-}
-
-{-
-This SOURCE-imported hs-boot module cuts a big dependency loop:
-
-module ‘GHC.Stable’
-imports module ‘GHC.Ptr’
-imports module ‘Numeric’
-imports module ‘GHC.Read’
-imports module ‘GHC.Unicode’
-imports module ‘GHC.Unicode.Internal.Char.UnicodeData.GeneralCategory’
-imports module ‘GHC.Unicode.Internal.Bits’
-imports module ‘GHC.ByteOrder’
-imports module ‘GHC.Generics’
-imports module ‘Data.Ord’
-imports module ‘Foreign.Storable’
-imports module ‘GHC.Stable’
--}
-
-module GHC.Internal.ByteOrder where
-
--- See W1 of Note [Tracking dependencies on primitives] in GHC.Internal.Base
-import GHC.Internal.Types ()
-
-data ByteOrder
- = BigEndian
- | LittleEndian
-
-targetByteOrder :: ByteOrder
=====================================
libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
=====================================
@@ -36,7 +36,6 @@ import GHC.Internal.Data.NonEmpty ( NonEmpty(..) )
import GHC.Internal.Data.Ord ( Down(..) )
import GHC.Internal.Data.Tuple ( Solo(..), snd )
import GHC.Internal.Base ( Monad, errorWithoutStackTrace, (.) )
-import GHC.Internal.Generics
import GHC.Internal.List ( head, drop )
import GHC.Internal.Control.Monad.ST.Imp
import GHC.Internal.System.IO
@@ -146,26 +145,6 @@ instance MonadFix f => MonadFix (Alt f) where
instance MonadFix f => MonadFix (Ap f) where
mfix f = Ap (mfix (getAp . f))
--- Instances for GHC.Generics
--- | @since base-4.9.0.0
-instance MonadFix Par1 where
- mfix f = Par1 (fix (unPar1 . f))
-
--- | @since base-4.9.0.0
-instance MonadFix f => MonadFix (Rec1 f) where
- mfix f = Rec1 (mfix (unRec1 . f))
-
--- | @since base-4.9.0.0
-instance MonadFix f => MonadFix (M1 i c f) where
- mfix f = M1 (mfix (unM1. f))
-
--- | @since base-4.9.0.0
-instance (MonadFix f, MonadFix g) => MonadFix (f :*: g) where
- mfix f = (mfix (fstP . f)) :*: (mfix (sndP . f))
- where
- fstP (a :*: _) = a
- sndP (_ :*: b) = b
-
-- Instances for Data.Ord
-- | @since base-4.12.0.0
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Foldable.hs
=====================================
@@ -64,7 +64,6 @@ import GHC.Internal.Arr ( Array(..), elems, numElements,
foldlElems', foldrElems',
foldl1Elems, foldr1Elems)
import GHC.Internal.Base hiding ( foldr )
-import GHC.Internal.Generics
import GHC.Internal.Tuple (Solo (..))
import GHC.Internal.Num ( Num(..) )
@@ -859,67 +858,6 @@ instance (Foldable f) => Foldable (Alt f) where
instance (Foldable f) => Foldable (Ap f) where
foldMap f = foldMap f . getAp
--- Instances for GHC.Generics
--- | @since base-4.9.0.0
-instance Foldable U1 where
- foldMap _ _ = mempty
- {-# INLINE foldMap #-}
- fold _ = mempty
- {-# INLINE fold #-}
- foldr _ z _ = z
- {-# INLINE foldr #-}
- foldl _ z _ = z
- {-# INLINE foldl #-}
- foldl1 _ _ = errorWithoutStackTrace "foldl1: U1"
- foldr1 _ _ = errorWithoutStackTrace "foldr1: U1"
- length _ = 0
- null _ = True
- elem _ _ = False
- sum _ = 0
- product _ = 1
-
--- | @since base-4.9.0.0
-deriving instance Foldable V1
-
--- | @since base-4.9.0.0
-deriving instance Foldable Par1
-
--- | @since base-4.9.0.0
-deriving instance Foldable f => Foldable (Rec1 f)
-
--- | @since base-4.9.0.0
-deriving instance Foldable (K1 i c)
-
--- | @since base-4.9.0.0
-deriving instance Foldable f => Foldable (M1 i c f)
-
--- | @since base-4.9.0.0
-deriving instance (Foldable f, Foldable g) => Foldable (f :+: g)
-
--- | @since base-4.9.0.0
-deriving instance (Foldable f, Foldable g) => Foldable (f :*: g)
-
--- | @since base-4.9.0.0
-deriving instance (Foldable f, Foldable g) => Foldable (f :.: g)
-
--- | @since base-4.9.0.0
-deriving instance Foldable UAddr
-
--- | @since base-4.9.0.0
-deriving instance Foldable UChar
-
--- | @since base-4.9.0.0
-deriving instance Foldable UDouble
-
--- | @since base-4.9.0.0
-deriving instance Foldable UFloat
-
--- | @since base-4.9.0.0
-deriving instance Foldable UInt
-
--- | @since base-4.9.0.0
-deriving instance Foldable UWord
-
-- Instances for Data.Ord
-- | @since base-4.12.0.0
deriving instance Foldable Down
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Functor/Const.hs
=====================================
@@ -29,7 +29,6 @@ import GHC.Internal.Ix (Ix)
import GHC.Internal.Base
import GHC.Internal.Enum (Bounded, Enum)
import GHC.Internal.Float (Floating, RealFloat)
-import GHC.Internal.Generics (Generic, Generic1)
import GHC.Internal.Num (Num)
import GHC.Internal.Real (Fractional, Integral, Real, RealFrac)
import GHC.Internal.Read (Read(readsPrec), readParen, lex)
@@ -57,8 +56,6 @@ newtype Const a b = Const { getConst :: a }
, FiniteBits -- ^ @since base-4.9.0.0
, Floating -- ^ @since base-4.9.0.0
, Fractional -- ^ @since base-4.9.0.0
- , Generic -- ^ @since base-4.9.0.0
- , Generic1 -- ^ @since base-4.9.0.0
, Integral -- ^ @since base-4.9.0.0
, Ix -- ^ @since base-4.9.0.0
, Semigroup -- ^ @since base-4.9.0.0
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs
=====================================
@@ -44,7 +44,6 @@ import GHC.Internal.Base ( Applicative(..), Eq(..), Functor(..), Monad(..)
, Semigroup, Monoid, Ord(..), ($), (.) )
import GHC.Internal.Enum (Bounded, Enum)
import GHC.Internal.Float (Floating, RealFloat)
-import GHC.Internal.Generics (Generic, Generic1)
import GHC.Internal.Num (Num)
import GHC.Internal.Read (Read(..), lex, readParen)
import GHC.Internal.Real (Fractional, Integral, Real, RealFrac)
@@ -78,8 +77,6 @@ newtype Identity a = Identity { runIdentity :: a }
, FiniteBits -- ^ @since base-4.9.0.0
, Floating -- ^ @since base-4.9.0.0
, Fractional -- ^ @since base-4.9.0.0
- , Generic -- ^ @since base-4.8.0.0
- , Generic1 -- ^ @since base-4.8.0.0
, Integral -- ^ @since base-4.9.0.0
, Ix -- ^ @since base-4.9.0.0
, Semigroup -- ^ @since base-4.9.0.0
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Monoid.hs
=====================================
@@ -1,4 +1,3 @@
-{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PolyKinds #-}
@@ -85,7 +84,6 @@ module GHC.Internal.Data.Monoid (
-- Push down the module in the dependency hierarchy.
import GHC.Internal.Base hiding (Any)
import GHC.Internal.Enum
-import GHC.Internal.Generics
import GHC.Internal.Num
import GHC.Internal.Read
import GHC.Internal.Show
@@ -148,8 +146,6 @@ newtype First a = First { getFirst :: Maybe a }
, Ord -- ^ @since base-2.01
, Read -- ^ @since base-2.01
, Show -- ^ @since base-2.01
- , Generic -- ^ @since base-4.7.0.0
- , Generic1 -- ^ @since base-4.7.0.0
, Functor -- ^ @since base-4.8.0.0
, Applicative -- ^ @since base-4.8.0.0
, Monad -- ^ @since base-4.8.0.0
@@ -190,8 +186,6 @@ newtype Last a = Last { getLast :: Maybe a }
, Ord -- ^ @since base-2.01
, Read -- ^ @since base-2.01
, Show -- ^ @since base-2.01
- , Generic -- ^ @since base-4.7.0.0
- , Generic1 -- ^ @since base-4.7.0.0
, Functor -- ^ @since base-4.8.0.0
, Applicative -- ^ @since base-4.8.0.0
, Monad -- ^ @since base-4.8.0.0
@@ -225,8 +219,6 @@ newtype Ap f a = Ap { getAp :: f a }
, Enum -- ^ @since base-4.12.0.0
, Eq -- ^ @since base-4.12.0.0
, Functor -- ^ @since base-4.12.0.0
- , Generic -- ^ @since base-4.12.0.0
- , Generic1 -- ^ @since base-4.12.0.0
, Monad -- ^ @since base-4.12.0.0
, MonadFail -- ^ @since base-4.12.0.0
, MonadPlus -- ^ @since base-4.12.0.0
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Semigroup/Internal.hs
=====================================
@@ -1,6 +1,5 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
@@ -26,7 +25,6 @@ import qualified GHC.Internal.List as List
import GHC.Internal.Num
import GHC.Internal.Read
import GHC.Internal.Show
-import GHC.Internal.Generics
import GHC.Internal.Real
-- | This is a valid definition of 'stimes' for an idempotent 'Semigroup'.
@@ -90,8 +88,6 @@ newtype Dual a = Dual { getDual :: a }
, Read -- ^ @since base-2.01
, Show -- ^ @since base-2.01
, Bounded -- ^ @since base-2.01
- , Generic -- ^ @since base-4.7.0.0
- , Generic1 -- ^ @since base-4.7.0.0
)
-- | @since base-4.9.0.0
@@ -130,8 +126,6 @@ instance Monad Dual where
-- >>> appEndo computation 1
-- 6
newtype Endo a = Endo { appEndo :: a -> a }
- deriving ( Generic -- ^ @since base-4.7.0.0
- )
-- | @since base-4.9.0.0
instance Semigroup (Endo a) where
@@ -200,7 +194,6 @@ newtype All = All { getAll :: Bool }
, Read -- ^ @since base-2.01
, Show -- ^ @since base-2.01
, Bounded -- ^ @since base-2.01
- , Generic -- ^ @since base-4.7.0.0
)
-- | @since base-4.9.0.0
@@ -232,7 +225,6 @@ newtype Any = Any { getAny :: Bool }
, Read -- ^ @since base-2.01
, Show -- ^ @since base-2.01
, Bounded -- ^ @since base-2.01
- , Generic -- ^ @since base-4.7.0.0
)
-- | @since base-4.9.0.0
@@ -261,8 +253,6 @@ newtype Sum a = Sum { getSum :: a }
, Read -- ^ @since base-2.01
, Show -- ^ @since base-2.01
, Bounded -- ^ @since base-2.01
- , Generic -- ^ @since base-4.7.0.0
- , Generic1 -- ^ @since base-4.7.0.0
, Num -- ^ @since base-4.7.0.0
)
@@ -309,8 +299,6 @@ newtype Product a = Product { getProduct :: a }
, Read -- ^ @since base-2.01
, Show -- ^ @since base-2.01
, Bounded -- ^ @since base-2.01
- , Generic -- ^ @since base-4.7.0.0
- , Generic1 -- ^ @since base-4.7.0.0
, Num -- ^ @since base-4.7.0.0
)
@@ -355,9 +343,7 @@ instance Monad Product where
--
-- @since base-4.8.0.0
newtype Alt f a = Alt {getAlt :: f a}
- deriving ( Generic -- ^ @since base-4.8.0.0
- , Generic1 -- ^ @since base-4.8.0.0
- , Read -- ^ @since base-4.8.0.0
+ deriving ( Read -- ^ @since base-4.8.0.0
, Show -- ^ @since base-4.8.0.0
, Eq -- ^ @since base-4.8.0.0
, Ord -- ^ @since base-4.8.0.0
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Traversable.hs
=====================================
@@ -51,8 +51,7 @@ import GHC.Internal.Data.Proxy ( Proxy(..) )
import GHC.Internal.Arr
import GHC.Internal.Base ( Applicative(..), Monad(..), Monoid, Maybe(..), NonEmpty(..),
- ($), (.), id, flip )
-import GHC.Internal.Generics
+ (.), id, flip, ($) )
import qualified GHC.Internal.List as List ( foldr )
import GHC.Internal.Tuple (Solo (..))
@@ -310,60 +309,6 @@ instance (Traversable f) => Traversable (Ap f) where
deriving instance Traversable Identity
--- Instances for GHC.Generics
--- | @since base-4.9.0.0
-instance Traversable U1 where
- traverse _ _ = pure U1
- {-# INLINE traverse #-}
- sequenceA _ = pure U1
- {-# INLINE sequenceA #-}
- mapM _ _ = pure U1
- {-# INLINE mapM #-}
- sequence _ = pure U1
- {-# INLINE sequence #-}
-
--- | @since base-4.9.0.0
-deriving instance Traversable V1
-
--- | @since base-4.9.0.0
-deriving instance Traversable Par1
-
--- | @since base-4.9.0.0
-deriving instance Traversable f => Traversable (Rec1 f)
-
--- | @since base-4.9.0.0
-deriving instance Traversable (K1 i c)
-
--- | @since base-4.9.0.0
-deriving instance Traversable f => Traversable (M1 i c f)
-
--- | @since base-4.9.0.0
-deriving instance (Traversable f, Traversable g) => Traversable (f :+: g)
-
--- | @since base-4.9.0.0
-deriving instance (Traversable f, Traversable g) => Traversable (f :*: g)
-
--- | @since base-4.9.0.0
-deriving instance (Traversable f, Traversable g) => Traversable (f :.: g)
-
--- | @since base-4.9.0.0
-deriving instance Traversable UAddr
-
--- | @since base-4.9.0.0
-deriving instance Traversable UChar
-
--- | @since base-4.9.0.0
-deriving instance Traversable UDouble
-
--- | @since base-4.9.0.0
-deriving instance Traversable UFloat
-
--- | @since base-4.9.0.0
-deriving instance Traversable UInt
-
--- | @since base-4.9.0.0
-deriving instance Traversable UWord
-
-- Instance for Data.Ord
-- | @since base-4.12.0.0
deriving instance Traversable Down
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Version.hs
=====================================
@@ -43,7 +43,6 @@ import GHC.Internal.Data.List ( map, sort, concat, concatMap, intersperse
import GHC.Internal.Data.Ord
import GHC.Internal.Data.String ( String )
import GHC.Internal.Base ( Applicative(..), (&&) )
-import GHC.Internal.Generics
import GHC.Internal.Unicode ( isDigit, isAlphaNum )
import GHC.Internal.Read
import GHC.Internal.Show
@@ -95,7 +94,6 @@ data Version =
}
deriving ( Read -- ^ @since base-2.01
, Show -- ^ @since base-2.01
- , Generic -- ^ @since base-4.9.0.0
)
{-# DEPRECATED versionTags "See GHC ticket #2496" #-}
-- TODO. Remove all references to versionTags in GHC 8.0 release.
=====================================
libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
=====================================
@@ -1,13 +1,11 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE DeriveFunctor #-}
-{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveFoldable #-}
module GHC.Internal.Functor.ZipList (ZipList(..)) where
import GHC.Internal.Base
-import GHC.Internal.Generics
import GHC.Internal.List (repeat, zipWith)
import GHC.Internal.Read (Read)
import GHC.Internal.Show (Show)
@@ -41,8 +39,6 @@ newtype ZipList a = ZipList { getZipList :: [a] }
, Read -- ^ @since base-4.7.0.0
, Functor -- ^ @since base-2.01
, Foldable -- ^ @since base-4.9.0.0
- , Generic -- ^ @since base-4.7.0.0
- , Generic1 -- ^ @since base-4.7.0.0
)
=====================================
libraries/ghc-internal/src/GHC/Internal/Generics.hs
=====================================
@@ -3,7 +3,9 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE EmptyDataDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
@@ -736,13 +738,13 @@ import GHC.Internal.Data.Ord ( Down(..) )
import GHC.Internal.Bignum.Integer ( Integer, integerToInt )
import GHC.Internal.Prim ( Addr#, Char#, Double#, Float#, Int#, Word# )
import GHC.Internal.Ptr ( Ptr(..) )
-import GHC.Internal.Types
+import GHC.Internal.Types hiding (Any) -- clashes with the Semigroup
-- Needed for instances
import GHC.Internal.Ix ( Ix )
import GHC.Internal.Base ( Alternative(..), Applicative(..), Functor(..)
, Monad(..), MonadPlus(..), NonEmpty(..), String, coerce
- , Semigroup(..), Monoid(..), Void )
+ , Semigroup(..), Void, errorWithoutStackTrace, (.) )
import GHC.Internal.Classes ( Eq(..), Ord(..) )
import GHC.Internal.Enum ( Bounded, Enum )
import GHC.Internal.Read ( Read(..) )
@@ -751,6 +753,18 @@ import GHC.Internal.Stack.Types ( SrcLoc(..) )
import GHC.Internal.Tuple (Solo (..))
import GHC.Internal.Unicode ( GeneralCategory(..) )
import GHC.Internal.Fingerprint.Type ( Fingerprint(..) )
+import GHC.Internal.Data.Semigroup.Internal
+import GHC.Internal.Data.Monoid
+import GHC.Internal.Data.Foldable
+import GHC.Internal.Data.Traversable
+import GHC.Internal.Data.Functor.Const
+import GHC.Internal.Data.Functor.Identity
+import GHC.Internal.Functor.ZipList
+import GHC.Internal.IO.Exception ( ExitCode(..) )
+import GHC.Internal.ByteOrder ( ByteOrder(..) )
+import GHC.Internal.Control.Monad.Fix
+import GHC.Internal.RTS.Flags
+import GHC.Internal.Data.Version
-- Needed for metadata
import GHC.Internal.Data.Proxy ( Proxy(..) )
@@ -1879,3 +1893,260 @@ instance SingKind DecidedStrictness where
fromSing SDecidedLazy = DecidedLazy
fromSing SDecidedStrict = DecidedStrict
fromSing SDecidedUnpack = DecidedUnpack
+
+-- | @since base-4.7.0.0
+deriving instance Generic (Dual a)
+
+-- | @since base-4.7.0.0
+deriving instance Generic1 Dual
+
+-- | @since base-4.7.0.0
+deriving instance Generic (Endo a)
+
+-- | @since base-4.7.0.0
+deriving instance Generic All
+
+-- | @since base-4.7.0.0
+deriving instance Generic Any
+
+-- | @since base-4.7.0.0
+deriving instance Generic (Sum a)
+
+-- | @since base-4.7.0.0
+deriving instance Generic1 Sum
+
+-- | @since base-4.7.0.0
+deriving instance Generic (Product a)
+
+-- | @since base-4.7.0.0
+deriving instance Generic1 Product
+
+-- | @since base-4.8.0.0
+deriving instance Generic (Alt f a)
+
+-- | @since base-4.8.0.0
+deriving instance Generic1 (Alt f)
+
+-- | @since base-4.7.0.0
+deriving instance Generic (First a)
+
+-- | @since base-4.7.0.0
+deriving instance Generic1 First
+
+-- | @since base-4.7.0.0
+deriving instance Generic (Last a)
+
+-- | @since base-4.7.0.0
+deriving instance Generic1 Last
+
+-- | @since base-4.12.0.0
+deriving instance Generic (Ap f a)
+
+-- | @since base-4.12.0.0
+deriving instance Generic1 (Ap f)
+
+-- | @since base-4.9.0.0
+instance Foldable U1 where
+ foldMap _ _ = mempty
+ {-# INLINE foldMap #-}
+ fold _ = mempty
+ {-# INLINE fold #-}
+ foldr _ z _ = z
+ {-# INLINE foldr #-}
+ foldl _ z _ = z
+ {-# INLINE foldl #-}
+ foldl1 _ _ = errorWithoutStackTrace "foldl1: U1"
+ foldr1 _ _ = errorWithoutStackTrace "foldr1: U1"
+ length _ = 0
+ null _ = True
+ elem _ _ = False
+ sum _ = 0
+ product _ = 1
+
+-- | @since base-4.9.0.0
+deriving instance Foldable V1
+
+-- | @since base-4.9.0.0
+deriving instance Foldable Par1
+
+-- | @since base-4.9.0.0
+deriving instance Foldable f => Foldable (Rec1 f)
+
+-- | @since base-4.9.0.0
+deriving instance Foldable (K1 i c)
+
+-- | @since base-4.9.0.0
+deriving instance Foldable f => Foldable (M1 i c f)
+
+-- | @since base-4.9.0.0
+deriving instance (Foldable f, Foldable g) => Foldable (f :+: g)
+
+-- | @since base-4.9.0.0
+deriving instance (Foldable f, Foldable g) => Foldable (f :*: g)
+
+-- | @since base-4.9.0.0
+deriving instance (Foldable f, Foldable g) => Foldable (f :.: g)
+
+-- | @since base-4.9.0.0
+deriving instance Foldable UAddr
+
+-- | @since base-4.9.0.0
+deriving instance Foldable UChar
+
+-- | @since base-4.9.0.0
+deriving instance Foldable UDouble
+
+-- | @since base-4.9.0.0
+deriving instance Foldable UFloat
+
+-- | @since base-4.9.0.0
+deriving instance Foldable UInt
+
+-- | @since base-4.9.0.0
+deriving instance Foldable UWord
+
+-- | @since base-4.9.0.0
+instance Traversable U1 where
+ traverse _ _ = pure U1
+ {-# INLINE traverse #-}
+ sequenceA _ = pure U1
+ {-# INLINE sequenceA #-}
+ mapM _ _ = pure U1
+ {-# INLINE mapM #-}
+ sequence _ = pure U1
+ {-# INLINE sequence #-}
+
+-- | @since base-4.9.0.0
+deriving instance Traversable V1
+
+-- | @since base-4.9.0.0
+deriving instance Traversable Par1
+
+-- | @since base-4.9.0.0
+deriving instance Traversable f => Traversable (Rec1 f)
+
+-- | @since base-4.9.0.0
+deriving instance Traversable (K1 i c)
+
+-- | @since base-4.9.0.0
+deriving instance Traversable f => Traversable (M1 i c f)
+
+-- | @since base-4.9.0.0
+deriving instance (Traversable f, Traversable g) => Traversable (f :+: g)
+
+-- | @since base-4.9.0.0
+deriving instance (Traversable f, Traversable g) => Traversable (f :*: g)
+
+-- | @since base-4.9.0.0
+deriving instance (Traversable f, Traversable g) => Traversable (f :.: g)
+
+-- | @since base-4.9.0.0
+deriving instance Traversable UAddr
+
+-- | @since base-4.9.0.0
+deriving instance Traversable UChar
+
+-- | @since base-4.9.0.0
+deriving instance Traversable UDouble
+
+-- | @since base-4.9.0.0
+deriving instance Traversable UFloat
+
+-- | @since base-4.9.0.0
+deriving instance Traversable UInt
+
+-- | @since base-4.9.0.0
+deriving instance Traversable UWord
+
+-- | @since base-4.9.0.0
+deriving instance Generic (Const a b)
+
+-- | @since base-4.9.0.0
+deriving instance Generic1 (Const a)
+
+-- | @since base-4.8.0.0
+deriving instance Generic (Identity a)
+
+-- | @since base-4.8.0.0
+deriving instance Generic1 Identity
+
+-- | @since base-4.7.0.0
+deriving instance Generic (ZipList a)
+
+-- | @since base-4.7.0.0
+deriving instance Generic1 ZipList
+
+-- TODO: since when??
+deriving instance Generic ExitCode
+
+-- | @since base-4.15.0.0
+deriving instance Generic ByteOrder
+
+-- | @since base-4.9.0.0
+instance MonadFix Par1 where
+ mfix f = Par1 (fix (unPar1 . f))
+
+-- | @since base-4.9.0.0
+instance MonadFix f => MonadFix (Rec1 f) where
+ mfix f = Rec1 (mfix (unRec1 . f))
+
+-- | @since base-4.9.0.0
+instance MonadFix f => MonadFix (M1 i c f) where
+ mfix f = M1 (mfix (unM1. f))
+
+-- | @since base-4.9.0.0
+instance (MonadFix f, MonadFix g) => MonadFix (f :*: g) where
+ mfix f = (mfix (fstP . f)) :*: (mfix (sndP . f))
+ where
+ fstP (a :*: _) = a
+ sndP (_ :*: b) = b
+
+-- Instances for RTS.Flags
+
+-- | @since base-4.15.0.0
+deriving instance Generic GiveGCStats
+
+-- | @since base-4.15.0.0
+deriving instance Generic GCFlags
+
+-- | @since base-4.15.0.0
+deriving instance Generic ConcFlags
+
+-- | @since base-4.15.0.0
+deriving instance Generic MiscFlags
+
+-- | @since base-4.15.0.0
+deriving instance Generic DebugFlags
+
+-- | @since base-4.15.0.0
+deriving instance Generic DoCostCentres
+
+-- | @since base-4.15.0.0
+deriving instance Generic CCFlags
+
+-- | @since base-4.15.0.0
+deriving instance Generic DoHeapProfile
+
+-- | @since base-4.15.0.0
+deriving instance Generic ProfFlags
+
+-- | @since base-4.15.0.0
+deriving instance Generic DoTrace
+
+-- | @since base-4.15.0.0
+deriving instance Generic TraceFlags
+
+-- | @since base-4.15.0.0
+deriving instance Generic TickyFlags
+
+-- | @since base-4.15.0.0
+deriving instance Generic ParFlags
+
+-- | @since base-4.15.0.0
+deriving instance Generic HpcFlags
+
+-- | @since base-4.15.0.0
+deriving instance Generic RTSFlags
+
+-- | @since base-4.9.0.0
+deriving instance Generic Version
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs
=====================================
@@ -1,5 +1,5 @@
{-# LANGUAGE Trustworthy #-}
-{-# LANGUAGE DeriveGeneric, NoImplicitPrelude, MagicHash,
+{-# LANGUAGE NoImplicitPrelude, MagicHash,
ExistentialQuantification, ImplicitParams #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
{-# OPTIONS_HADDOCK not-home #-}
@@ -52,7 +52,6 @@ module GHC.Internal.IO.Exception (
) where
import GHC.Internal.Base
-import GHC.Internal.Generics
import GHC.Internal.List
import GHC.Internal.IO
import GHC.Internal.Show
@@ -306,7 +305,7 @@ data ExitCode
-- The exact interpretation of the code is
-- operating-system dependent. In particular, some values
-- may be prohibited (e.g. 0 on a POSIX-compliant system).
- deriving (Eq, Ord, Read, Show, Generic)
+ deriving (Eq, Ord, Read, Show)
-- | @since base-4.1.0.0
instance Exception ExitCode
=====================================
libraries/ghc-internal/src/GHC/Internal/RTS/Flags.hsc
=====================================
@@ -63,7 +63,6 @@ import GHC.Internal.Ptr
import GHC.Internal.Word
import GHC.Internal.Base
import GHC.Internal.Enum
-import GHC.Internal.Generics (Generic)
import GHC.Internal.IO
import GHC.Internal.Real
import GHC.Internal.Show
@@ -84,7 +83,6 @@ data GiveGCStats
| SummaryGCStats
| VerboseGCStats
deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | @since base-4.8.0.0
@@ -136,7 +134,6 @@ data GCFlags = GCFlags
, numa :: Bool
, numaMask :: Word
} deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | Parameters concerning context switching
@@ -146,7 +143,6 @@ data ConcFlags = ConcFlags
{ ctxtSwitchTime :: RtsTime
, ctxtSwitchTicks :: Int
} deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | Miscellaneous parameters
@@ -169,7 +165,6 @@ data MiscFlags = MiscFlags
, ioManager :: IoManagerFlag
, numIoWorkerThreads :: Word32
} deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- |
@@ -206,7 +201,6 @@ data DebugFlags = DebugFlags
, hpc :: Bool -- ^ @c@ coverage
, sparks :: Bool -- ^ @r@
} deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | Should the RTS produce a cost-center summary?
@@ -219,7 +213,6 @@ data DoCostCentres
| CostCentresAll
| CostCentresJSON
deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | @since base-4.8.0.0
@@ -245,7 +238,6 @@ data CCFlags = CCFlags
, profilerTicks :: Int
, msecsPerTick :: Int
} deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | What sort of heap profile are we collecting?
@@ -263,7 +255,6 @@ data DoHeapProfile
| HeapByInfoTable
| HeapByEra -- ^ @since base-4.20.0.0
deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | @since base-4.8.0.0
@@ -315,7 +306,6 @@ data ProfFlags = ProfFlags
, closureTypeSelector :: Maybe String
, infoTableSelector :: Maybe String
} deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | Is event tracing enabled?
@@ -326,7 +316,6 @@ data DoTrace
| TraceEventLog -- ^ send tracing events to the event log
| TraceStderr -- ^ send tracing events to @stderr@
deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | @since base-4.8.0.0
@@ -354,7 +343,6 @@ data TraceFlags = TraceFlags
, sparksFull :: Bool -- ^ trace spark events 100% accurately
, user :: Bool -- ^ trace user events (emitted from Haskell code)
} deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | Parameters pertaining to ticky-ticky profiler
@@ -364,7 +352,6 @@ data TickyFlags = TickyFlags
{ showTickyStats :: Bool
, tickyFile :: Maybe FilePath
} deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | Parameters pertaining to parallelism
@@ -383,7 +370,6 @@ data ParFlags = ParFlags
, setAffinity :: Bool
}
deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
-- | Parameters pertaining to Haskell program coverage (HPC)
@@ -399,7 +385,6 @@ data HpcFlags = HpcFlags
-- written after the execution of the program.
}
deriving (Show -- ^ @since base-4.20.0.0
- , Generic -- ^ @since base-4.20.0.0
)
-- | Parameters of the runtime system
--
@@ -416,7 +401,6 @@ data RTSFlags = RTSFlags
, parFlags :: ParFlags
, hpcFlags :: HpcFlags
} deriving ( Show -- ^ @since base-4.8.0.0
- , Generic -- ^ @since base-4.15.0.0
)
foreign import ccall "&RtsFlags" rtsFlagsPtr :: Ptr RTSFlags
=====================================
libraries/ghc-internal/src/GHC/Internal/Read.hs
=====================================
@@ -74,6 +74,7 @@ import GHC.Internal.Arr
import GHC.Internal.Word
import GHC.Internal.List (filter)
import GHC.Internal.Tuple (Solo (..))
+import GHC.Internal.ByteOrder
-- | @'readParen' 'True' p@ parses what @p@ parses, but surrounded with
@@ -833,3 +834,6 @@ instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h,
; return (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) })
readListPrec = readListPrecDefault
readList = readListDefault
+
+-- | @since base-4.11.0.0
+deriving instance Read ByteOrder
=====================================
libraries/ghc-internal/src/GHC/Internal/Unicode/Bits.hs
=====================================
@@ -31,7 +31,7 @@ module GHC.Internal.Unicode.Bits
where
import GHC.Internal.Bits (finiteBitSize, popCount)
-import {-# SOURCE #-} GHC.Internal.ByteOrder
+import GHC.Internal.ByteOrder
import GHC.Internal.Prim
import GHC.Internal.ST
import GHC.Internal.Base
=====================================
testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
=====================================
@@ -21,13 +21,13 @@ instance Applicative Solo -- Defined in ‘GHC.Internal.Base’
instance Foldable Solo -- Defined in ‘GHC.Internal.Data.Foldable’
instance Functor Solo -- Defined in ‘GHC.Internal.Base’
instance Monad Solo -- Defined in ‘GHC.Internal.Base’
+instance Read a => Read (Solo a) -- Defined in ‘GHC.Internal.Read’
instance Bounded a => Bounded (Solo a)
-- Defined in ‘GHC.Internal.Enum’
instance Enum a => Enum (Solo a) -- Defined in ‘GHC.Internal.Enum’
-instance Read a => Read (Solo a) -- Defined in ‘GHC.Internal.Read’
-instance Eq a => Eq (Solo a) -- Defined in ‘GHC.Internal.Classes’
instance Ord a => Ord (Solo a) -- Defined in ‘GHC.Internal.Classes’
instance Show a => Show (Solo a) -- Defined in ‘GHC.Internal.Show’
+instance Eq a => Eq (Solo a) -- Defined in ‘GHC.Internal.Classes’
instance Monoid a => Monoid (Solo a)
-- Defined in ‘GHC.Internal.Base’
instance Semigroup a => Semigroup (Solo a)
=====================================
testsuite/tests/ghci/scripts/T10963.stderr
=====================================
@@ -1,4 +1,3 @@
-
<interactive>:1:1: error: [GHC-39999]
• Ambiguous type variable ‘a0’ arising from a use of ‘foo’
prevents the constraint ‘(Num a0)’ from being solved.
@@ -7,6 +6,7 @@
instance Num Integer -- Defined in ‘GHC.Internal.Num’
instance Num Double -- Defined in ‘GHC.Internal.Float’
...plus three others
- ...plus one instance involving out-of-scope types
+ ...plus four instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the expression: foo
+
=====================================
testsuite/tests/ghci/scripts/ghci064.stdout
=====================================
@@ -10,11 +10,6 @@ instance MonadFail Maybe
instance GHC.Internal.Base.MonadPlus Maybe
-- Defined in ‘GHC.Internal.Base’
instance Monad Maybe -- Defined in ‘GHC.Internal.Base’
-instance GHC.Internal.Generics.SingKind w =>
- GHC.Internal.Generics.SingKind (Maybe w)
- -- Defined in ‘GHC.Internal.Generics’
-instance GHC.Internal.Generics.Generic (Maybe w)
- -- Defined in ‘GHC.Internal.Generics’
instance Semigroup w => Monoid (Maybe w)
-- Defined in ‘GHC.Internal.Base’
instance Read w => Read (Maybe w) -- Defined in ‘GHC.Internal.Read’
@@ -25,26 +20,18 @@ instance [safe] Ord w => Ord (Maybe w)
instance Show w => Show (Maybe w) -- Defined in ‘GHC.Internal.Show’
instance [safe] Eq w => Eq (Maybe w)
-- Defined in ‘GHC.Internal.Maybe’
-instance GHC.Internal.Generics.Generic [w]
- -- Defined in ‘GHC.Internal.Generics’
instance Read w => Read [w] -- Defined in ‘GHC.Internal.Read’
-instance Eq w => Eq [w] -- Defined in ‘GHC.Internal.Classes’
instance Ord w => Ord [w] -- Defined in ‘GHC.Internal.Classes’
instance Show w => Show [w] -- Defined in ‘GHC.Internal.Show’
+instance Eq w => Eq [w] -- Defined in ‘GHC.Internal.Classes’
instance Monoid [w] -- Defined in ‘GHC.Internal.Base’
instance Semigroup [w] -- Defined in ‘GHC.Internal.Base’
instance [safe] MyShow w => MyShow [w]
-- Defined at ghci064.hs:8:10
-instance GHC.Internal.Generics.Generic [T]
- -- Defined in ‘GHC.Internal.Generics’
instance Monoid [T] -- Defined in ‘GHC.Internal.Base’
instance Semigroup [T] -- Defined in ‘GHC.Internal.Base’
instance [safe] MyShow [T] -- Defined at ghci064.hs:16:10
instance [safe] MyShow [T] -- Defined at ghci064.hs:8:10
-instance GHC.Internal.Generics.SingKind Bool
- -- Defined in ‘GHC.Internal.Generics’
-instance GHC.Internal.Generics.Generic Bool
- -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Foreign.Storable.Storable Bool
-- Defined in ‘GHC.Internal.Foreign.Storable’
instance GHC.Internal.Bits.Bits Bool
=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -11544,7 +11544,6 @@ instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fail.MonadFail f => GH
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.P -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.ReadP -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadPrec.ReadPrec -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadPrec’
-instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Ord.Down -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11555,12 +11554,9 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Maybe.Maybe -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Control.Monad.Fix’
-instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance forall s. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.ST.ST s) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix Solo -- Defined in ‘GHC.Internal.Control.Monad.Fix’
instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Control.Monad.Fix’
@@ -11573,6 +11569,10 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.First -- Defined
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Max -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.Semigroup.Min -- Defined in ‘Data.Semigroup’
+instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Generics’
+instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Generics’
+instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Control.Monad.IO.Class.MonadIO GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.IO.Class’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Zip.MonadZip f, GHC.Internal.Control.Monad.Zip.MonadZip g) => GHC.Internal.Control.Monad.Zip.MonadZip (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Zip’
instance forall (f :: * -> *). GHC.Internal.Control.Monad.Zip.MonadZip f => GHC.Internal.Control.Monad.Zip.MonadZip (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Zip’
@@ -11737,9 +11737,6 @@ instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data
instance forall m. GHC.Internal.Data.Data.Data m => GHC.Internal.Data.Data.Data (Data.Semigroup.WrappedMonoid m) -- Defined in ‘Data.Semigroup’
instance forall m. GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Data.Functor.Const.Const m) -- Defined in ‘GHC.Internal.Data.Functor.Const’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
-instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Data.Foldable’
-instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (f GHC.Internal.Generics.:+: g) -- Defined in ‘GHC.Internal.Data.Foldable’
-instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (f GHC.Internal.Generics.:.: g) -- Defined in ‘GHC.Internal.Data.Foldable’
instance forall (f :: * -> *). GHC.Internal.Data.Foldable.Foldable f => GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Data.Foldable’
instance forall (f :: * -> *). GHC.Internal.Data.Foldable.Foldable f => GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Data.Foldable’
instance forall i. GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Arr.Array i) -- Defined in ‘GHC.Internal.Data.Foldable’
@@ -11747,27 +11744,15 @@ instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Data.Ord.Down -- Defin
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Data.Semigroup.Internal.Dual -- Defined in ‘GHC.Internal.Data.Foldable’
instance forall a. GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Data.Either.Either a) -- Defined in ‘GHC.Internal.Data.Foldable’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Data.Foldable’
-instance forall i c. GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Generics.K1 i c) -- Defined in ‘GHC.Internal.Data.Foldable’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Data.Foldable’
instance GHC.Internal.Data.Foldable.Foldable [] -- Defined in ‘GHC.Internal.Data.Foldable’
-instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Data.Foldable.Foldable f => GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Data.Foldable’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Maybe.Maybe -- Defined in ‘GHC.Internal.Data.Foldable’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Data.Foldable’
-instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Data.Foldable’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Data.Foldable’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Data.Proxy.Proxy -- Defined in ‘GHC.Internal.Data.Foldable’
-instance forall (f :: * -> *). GHC.Internal.Data.Foldable.Foldable f => GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Data.Foldable’
instance GHC.Internal.Data.Foldable.Foldable Solo -- Defined in ‘GHC.Internal.Data.Foldable’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Data.Foldable’
instance forall a. GHC.Internal.Data.Foldable.Foldable ((,) a) -- Defined in ‘GHC.Internal.Data.Foldable’
-instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.U1 -- Defined in ‘GHC.Internal.Data.Foldable’
-instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UAddr -- Defined in ‘GHC.Internal.Data.Foldable’
-instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UChar -- Defined in ‘GHC.Internal.Data.Foldable’
-instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UDouble -- Defined in ‘GHC.Internal.Data.Foldable’
-instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UFloat -- Defined in ‘GHC.Internal.Data.Foldable’
-instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UInt -- Defined in ‘GHC.Internal.Data.Foldable’
-instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UWord -- Defined in ‘GHC.Internal.Data.Foldable’
-instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.V1 -- Defined in ‘GHC.Internal.Data.Foldable’
instance GHC.Internal.Data.Foldable.Foldable Data.Complex.Complex -- Defined in ‘Data.Complex’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (Data.Functor.Compose.Compose f g) -- Defined in ‘Data.Functor.Compose’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Functor.Identity’
@@ -11778,13 +11763,25 @@ instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.First -- Defined in
instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Max -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Min -- Defined in ‘Data.Semigroup’
+instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Generics’
+instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (f GHC.Internal.Generics.:+: g) -- Defined in ‘GHC.Internal.Generics’
+instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (f GHC.Internal.Generics.:.: g) -- Defined in ‘GHC.Internal.Generics’
+instance forall i c. GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Generics.K1 i c) -- Defined in ‘GHC.Internal.Generics’
+instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Data.Foldable.Foldable f => GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Generics’
+instance forall (f :: * -> *). GHC.Internal.Data.Foldable.Foldable f => GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.U1 -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UAddr -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UChar -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UDouble -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UFloat -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UInt -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.UWord -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Generics.V1 -- Defined in ‘GHC.Internal.Generics’
instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.String’
instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Data.String’
instance forall a. (a ~ GHC.Internal.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
-instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Data.Traversable’
-instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (f GHC.Internal.Generics.:+: g) -- Defined in ‘GHC.Internal.Data.Traversable’
-instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (f GHC.Internal.Generics.:.: g) -- Defined in ‘GHC.Internal.Data.Traversable’
instance forall (f :: * -> *). GHC.Internal.Data.Traversable.Traversable f => GHC.Internal.Data.Traversable.Traversable (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Data.Traversable’
instance forall (f :: * -> *). GHC.Internal.Data.Traversable.Traversable f => GHC.Internal.Data.Traversable.Traversable (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Data.Traversable’
instance forall i. GHC.Internal.Ix.Ix i => GHC.Internal.Data.Traversable.Traversable (GHC.Internal.Arr.Array i) -- Defined in ‘GHC.Internal.Data.Traversable’
@@ -11794,27 +11791,15 @@ instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Data.Semigroup.I
instance forall a. GHC.Internal.Data.Traversable.Traversable (GHC.Internal.Data.Either.Either a) -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Traversable’
-instance forall i c. GHC.Internal.Data.Traversable.Traversable (GHC.Internal.Generics.K1 i c) -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable [] -- Defined in ‘GHC.Internal.Data.Traversable’
-instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Data.Traversable.Traversable f => GHC.Internal.Data.Traversable.Traversable (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Maybe.Maybe -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Data.Traversable’
-instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Data.Proxy.Proxy -- Defined in ‘GHC.Internal.Data.Traversable’
-instance forall (f :: * -> *). GHC.Internal.Data.Traversable.Traversable f => GHC.Internal.Data.Traversable.Traversable (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable Solo -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Data.Traversable’
instance forall a. GHC.Internal.Data.Traversable.Traversable ((,) a) -- Defined in ‘GHC.Internal.Data.Traversable’
-instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.U1 -- Defined in ‘GHC.Internal.Data.Traversable’
-instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UAddr -- Defined in ‘GHC.Internal.Data.Traversable’
-instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UChar -- Defined in ‘GHC.Internal.Data.Traversable’
-instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UDouble -- Defined in ‘GHC.Internal.Data.Traversable’
-instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UFloat -- Defined in ‘GHC.Internal.Data.Traversable’
-instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UInt -- Defined in ‘GHC.Internal.Data.Traversable’
-instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UWord -- Defined in ‘GHC.Internal.Data.Traversable’
-instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.V1 -- Defined in ‘GHC.Internal.Data.Traversable’
instance GHC.Internal.Data.Traversable.Traversable Data.Complex.Complex -- Defined in ‘Data.Complex’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (Data.Functor.Compose.Compose f g) -- Defined in ‘Data.Functor.Compose’
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
@@ -11824,6 +11809,21 @@ instance GHC.Internal.Data.Traversable.Traversable Data.Semigroup.First -- Defin
instance GHC.Internal.Data.Traversable.Traversable Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Data.Traversable.Traversable Data.Semigroup.Max -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Data.Traversable.Traversable Data.Semigroup.Min -- Defined in ‘Data.Semigroup’
+instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Generics’
+instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (f GHC.Internal.Generics.:+: g) -- Defined in ‘GHC.Internal.Generics’
+instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (f GHC.Internal.Generics.:.: g) -- Defined in ‘GHC.Internal.Generics’
+instance forall i c. GHC.Internal.Data.Traversable.Traversable (GHC.Internal.Generics.K1 i c) -- Defined in ‘GHC.Internal.Generics’
+instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Data.Traversable.Traversable f => GHC.Internal.Data.Traversable.Traversable (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Generics’
+instance forall (f :: * -> *). GHC.Internal.Data.Traversable.Traversable f => GHC.Internal.Data.Traversable.Traversable (GHC.Internal.Generics.Rec1 f) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.U1 -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UAddr -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UChar -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UDouble -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UFloat -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UInt -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.UWord -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Generics.V1 -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Data.Type.Coercion.TestCoercion GHC.Internal.TypeNats.SNat -- Defined in ‘GHC.Internal.TypeNats’
instance GHC.Internal.Data.Type.Coercion.TestCoercion GHC.Internal.TypeLits.SChar -- Defined in ‘GHC.Internal.TypeLits’
instance GHC.Internal.Data.Type.Coercion.TestCoercion GHC.Internal.TypeLits.SSymbol -- Defined in ‘GHC.Internal.TypeLits’
@@ -12110,57 +12110,70 @@ instance forall (n :: GHC.Internal.Types.Symbol) (f :: GHC.Internal.Generics.Fix
instance forall (n :: GHC.Internal.Types.Symbol) (m :: GHC.Internal.Types.Symbol) (p :: GHC.Internal.Types.Symbol) (nt :: GHC.Internal.Types.Bool). (GHC.Internal.TypeLits.KnownSymbol n, GHC.Internal.TypeLits.KnownSymbol m, GHC.Internal.TypeLits.KnownSymbol p, GHC.Internal.Generics.SingI nt) => GHC.Internal.Generics.Datatype (GHC.Internal.Generics.MetaData n m p nt) -- Defined in ‘GHC.Internal.Generics’
instance forall (a :: * -> * -> *) b c. GHC.Internal.Generics.Generic (Control.Applicative.WrappedArrow a b c) -- Defined in ‘Control.Applicative’
instance forall (m :: * -> *) a. GHC.Internal.Generics.Generic (Control.Applicative.WrappedMonad m a) -- Defined in ‘Control.Applicative’
-instance forall a k (b :: k). GHC.Internal.Generics.Generic (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’
-instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Functor.ZipList.ZipList a) -- Defined in ‘GHC.Internal.Functor.ZipList’
instance forall (m :: * -> *) a b. GHC.Internal.Generics.Generic (GHC.Internal.Control.Arrow.Kleisli m a b) -- Defined in ‘GHC.Internal.Control.Arrow’
-instance GHC.Internal.Generics.Generic GHC.Internal.IO.Exception.ExitCode -- Defined in ‘GHC.Internal.IO.Exception’
instance forall a. GHC.Internal.Generics.Generic (Data.Complex.Complex a) -- Defined in ‘Data.Complex’
instance forall k1 (f :: k1 -> *) k2 (g :: k2 -> k1) (a :: k2). GHC.Internal.Generics.Generic (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’
-instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Data.Functor.Identity’
instance [safe] forall k (f :: k -> *) (g :: k -> *) (a :: k). GHC.Internal.Generics.Generic (Data.Functor.Product.Product f g a) -- Defined in ‘Data.Functor.Product’
instance [safe] forall k (f :: k -> *) (g :: k -> *) (a :: k). GHC.Internal.Generics.Generic (Data.Functor.Sum.Sum f g a) -- Defined in ‘Data.Functor.Sum’
-instance GHC.Internal.Generics.Generic GHC.Internal.Data.Semigroup.Internal.All -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance forall k (f :: k -> *) (a :: k). GHC.Internal.Generics.Generic (GHC.Internal.Data.Semigroup.Internal.Alt f a) -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance GHC.Internal.Generics.Generic GHC.Internal.Data.Semigroup.Internal.Any -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Semigroup.Internal.Dual a) -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Semigroup.Internal.Endo a) -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Semigroup.Internal.Product a) -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Semigroup.Internal.Sum a) -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance forall k (f :: k -> *) (a :: k). GHC.Internal.Generics.Generic (GHC.Internal.Data.Monoid.Ap f a) -- Defined in ‘GHC.Internal.Data.Monoid’
-instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Monoid.First a) -- Defined in ‘GHC.Internal.Data.Monoid’
-instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Monoid.Last a) -- Defined in ‘GHC.Internal.Data.Monoid’
instance forall a b. GHC.Internal.Generics.Generic (Data.Semigroup.Arg a b) -- Defined in ‘Data.Semigroup’
instance forall a. GHC.Internal.Generics.Generic (Data.Semigroup.First a) -- Defined in ‘Data.Semigroup’
instance forall a. GHC.Internal.Generics.Generic (Data.Semigroup.Last a) -- Defined in ‘Data.Semigroup’
instance forall a. GHC.Internal.Generics.Generic (Data.Semigroup.Max a) -- Defined in ‘Data.Semigroup’
instance forall a. GHC.Internal.Generics.Generic (Data.Semigroup.Min a) -- Defined in ‘Data.Semigroup’
instance forall m. GHC.Internal.Generics.Generic (Data.Semigroup.WrappedMonoid m) -- Defined in ‘Data.Semigroup’
-instance GHC.Internal.Generics.Generic GHC.Internal.Data.Version.Version -- Defined in ‘GHC.Internal.Data.Version’
-instance GHC.Internal.Generics.Generic GHC.Internal.ByteOrder.ByteOrder -- Defined in ‘GHC.Internal.ByteOrder’
instance forall k (f :: k -> *) (g :: k -> *) (p :: k). GHC.Internal.Generics.Generic ((GHC.Internal.Generics.:*:) f g p) -- Defined in ‘GHC.Internal.Generics’
instance forall k (f :: k -> *) (g :: k -> *) (p :: k). GHC.Internal.Generics.Generic ((GHC.Internal.Generics.:+:) f g p) -- Defined in ‘GHC.Internal.Generics’
instance forall k2 (f :: k2 -> *) k1 (g :: k1 -> k2) (p :: k1). GHC.Internal.Generics.Generic ((GHC.Internal.Generics.:.:) f g p) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.Data.Semigroup.Internal.All -- Defined in ‘GHC.Internal.Generics’
+instance forall k (f :: k -> *) (a :: k). GHC.Internal.Generics.Generic (GHC.Internal.Data.Semigroup.Internal.Alt f a) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.Data.Semigroup.Internal.Any -- Defined in ‘GHC.Internal.Generics’
+instance forall k (f :: k -> *) (a :: k). GHC.Internal.Generics.Generic (GHC.Internal.Data.Monoid.Ap f a) -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Generics.Associativity -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Types.Bool -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.ByteOrder.ByteOrder -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.CCFlags -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.ConcFlags -- Defined in ‘GHC.Internal.Generics’
+instance forall k a (b :: k). GHC.Internal.Generics.Generic (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DebugFlags -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Generics.DecidedStrictness -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DoCostCentres -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DoHeapProfile -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DoTrace -- Defined in ‘GHC.Internal.Generics’
instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Generics’
+instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Semigroup.Internal.Dual a) -- Defined in ‘GHC.Internal.Generics’
instance forall a b. GHC.Internal.Generics.Generic (GHC.Internal.Data.Either.Either a b) -- Defined in ‘GHC.Internal.Generics’
+instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Semigroup.Internal.Endo a) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.IO.Exception.ExitCode -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Fingerprint.Type.Fingerprint -- Defined in ‘GHC.Internal.Generics’
+instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Monoid.First a) -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Generics.Fixity -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.GCFlags -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Unicode.GeneralCategory -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.GiveGCStats -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.HpcFlags -- Defined in ‘GHC.Internal.Generics’
+instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Generics’
instance forall i c k (p :: k). GHC.Internal.Generics.Generic (GHC.Internal.Generics.K1 i c p) -- Defined in ‘GHC.Internal.Generics’
+instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Monoid.Last a) -- Defined in ‘GHC.Internal.Generics’
instance forall a. GHC.Internal.Generics.Generic [a] -- Defined in ‘GHC.Internal.Generics’
instance forall i (c :: GHC.Internal.Generics.Meta) k (f :: k -> *) (p :: k). GHC.Internal.Generics.Generic (GHC.Internal.Generics.M1 i c f p) -- Defined in ‘GHC.Internal.Generics’
instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Maybe.Maybe a) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.MiscFlags -- Defined in ‘GHC.Internal.Generics’
instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Types.Ordering -- Defined in ‘GHC.Internal.Generics’
instance forall p. GHC.Internal.Generics.Generic (GHC.Internal.Generics.Par1 p) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.ParFlags -- Defined in ‘GHC.Internal.Generics’
+instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Semigroup.Internal.Product a) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.ProfFlags -- Defined in ‘GHC.Internal.Generics’
instance forall k (t :: k). GHC.Internal.Generics.Generic (GHC.Internal.Data.Proxy.Proxy t) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.RTSFlags -- Defined in ‘GHC.Internal.Generics’
instance forall k (f :: k -> *) (p :: k). GHC.Internal.Generics.Generic (GHC.Internal.Generics.Rec1 f p) -- Defined in ‘GHC.Internal.Generics’
instance forall a. GHC.Internal.Generics.Generic (Solo a) -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Generics.SourceStrictness -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Generics.SourceUnpackedness -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Stack.Types.SrcLoc -- Defined in ‘GHC.Internal.Generics’
+instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Data.Semigroup.Internal.Sum a) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.TickyFlags -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.TraceFlags -- Defined in ‘GHC.Internal.Generics’
instance forall a b c d e f g h i j. GHC.Internal.Generics.Generic (a, b, c, d, e, f, g, h, i, j) -- Defined in ‘GHC.Internal.Generics’
instance forall a b c d e f g h i j k. GHC.Internal.Generics.Generic (a, b, c, d, e, f, g, h, i, j, k) -- Defined in ‘GHC.Internal.Generics’
instance forall a b c d e f g h i j k l. GHC.Internal.Generics.Generic (a, b, c, d, e, f, g, h, i, j, k, l) -- Defined in ‘GHC.Internal.Generics’
@@ -12184,7 +12197,9 @@ instance forall k (p :: k). GHC.Internal.Generics.Generic (GHC.Internal.Generics
instance forall k (p :: k). GHC.Internal.Generics.Generic (GHC.Internal.Generics.URec (GHC.Internal.Ptr.Ptr ()) p) -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic () -- Defined in ‘GHC.Internal.Generics’
instance forall k (p :: k). GHC.Internal.Generics.Generic (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic GHC.Internal.Data.Version.Version -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.Internal.Base.Void -- Defined in ‘GHC.Internal.Generics’
+instance forall a. GHC.Internal.Generics.Generic (GHC.Internal.Functor.ZipList.ZipList a) -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic GHC.RTS.Flags.CCFlags -- Defined in ‘GHC.RTS.Flags’
instance GHC.Internal.Generics.Generic GHC.RTS.Flags.ConcFlags -- Defined in ‘GHC.RTS.Flags’
instance GHC.Internal.Generics.Generic GHC.RTS.Flags.DebugFlags -- Defined in ‘GHC.RTS.Flags’
@@ -12204,15 +12219,8 @@ instance [safe] GHC.Internal.Generics.Generic GHC.Stats.GCDetails -- Defined in
instance [safe] GHC.Internal.Generics.Generic GHC.Stats.RTSStats -- Defined in ‘GHC.Stats’
instance forall (a :: * -> * -> *) b. GHC.Internal.Generics.Generic1 (Control.Applicative.WrappedArrow a b) -- Defined in ‘Control.Applicative’
instance forall (m :: * -> *). GHC.Internal.Generics.Generic1 (Control.Applicative.WrappedMonad m) -- Defined in ‘Control.Applicative’
-instance GHC.Internal.Generics.Generic1 GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
instance forall (m :: * -> *) a. GHC.Internal.Generics.Generic1 (GHC.Internal.Control.Arrow.Kleisli m a) -- Defined in ‘GHC.Internal.Control.Arrow’
instance GHC.Internal.Generics.Generic1 Data.Complex.Complex -- Defined in ‘Data.Complex’
-instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Data.Functor.Identity’
-instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Semigroup.Internal.Dual -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Data.Monoid’
-instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Data.Monoid’
instance forall a. GHC.Internal.Generics.Generic1 (Data.Semigroup.Arg a) -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Generics.Generic1 Data.Semigroup.First -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Generics.Generic1 Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
@@ -12220,12 +12228,18 @@ instance GHC.Internal.Generics.Generic1 Data.Semigroup.Max -- Defined in ‘Data
instance GHC.Internal.Generics.Generic1 Data.Semigroup.Min -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Generics.Generic1 Data.Semigroup.WrappedMonoid -- Defined in ‘Data.Semigroup’
instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Ord.Down -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Semigroup.Internal.Dual -- Defined in ‘GHC.Internal.Generics’
instance forall a. GHC.Internal.Generics.Generic1 (GHC.Internal.Data.Either.Either a) -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Functor.Identity.Identity -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic1 [] -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic1 GHC.Internal.Maybe.Maybe -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic1 GHC.Internal.Base.NonEmpty -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic1 GHC.Internal.Generics.Par1 -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Semigroup.Internal.Product -- Defined in ‘GHC.Internal.Generics’
instance GHC.Internal.Generics.Generic1 Solo -- Defined in ‘GHC.Internal.Generics’
+instance GHC.Internal.Generics.Generic1 GHC.Internal.Data.Semigroup.Internal.Sum -- Defined in ‘GHC.Internal.Generics’
instance forall a b c d e f g h i. GHC.Internal.Generics.Generic1 ((,,,,,,,,,) a b c d e f g h i) -- Defined in ‘GHC.Internal.Generics’
instance forall a b c d e f g h i j. GHC.Internal.Generics.Generic1 ((,,,,,,,,,,) a b c d e f g h i j) -- Defined in ‘GHC.Internal.Generics’
instance forall a b c d e f g h i j k. GHC.Internal.Generics.Generic1 ((,,,,,,,,,,,) a b c d e f g h i j k) -- Defined in ‘GHC.Internal.Generics’
@@ -12240,15 +12254,16 @@ instance forall a b c d e. GHC.Internal.Generics.Generic1 ((,,,,,) a b c d e) --
instance forall a b c d e f. GHC.Internal.Generics.Generic1 ((,,,,,,) a b c d e f) -- Defined in ‘GHC.Internal.Generics’
instance forall a b c d e f g. GHC.Internal.Generics.Generic1 ((,,,,,,,) a b c d e f g) -- Defined in ‘GHC.Internal.Generics’
instance forall a b c d e f g h. GHC.Internal.Generics.Generic1 ((,,,,,,,,) a b c d e f g h) -- Defined in ‘GHC.Internal.Generics’
-instance forall k1 a. GHC.Internal.Generics.Generic1 (GHC.Internal.Data.Functor.Const.Const a) -- Defined in ‘GHC.Internal.Data.Functor.Const’
+instance GHC.Internal.Generics.Generic1 GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Generics’
instance forall (f :: * -> *) k1 (g :: k1 -> *). GHC.Internal.Base.Functor f => GHC.Internal.Generics.Generic1 (Data.Functor.Compose.Compose f g) -- Defined in ‘Data.Functor.Compose’
instance [safe] forall k1 (f :: k1 -> *) (g :: k1 -> *). GHC.Internal.Generics.Generic1 (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance [safe] forall k1 (f :: k1 -> *) (g :: k1 -> *). GHC.Internal.Generics.Generic1 (Data.Functor.Sum.Sum f g) -- Defined in ‘Data.Functor.Sum’
-instance forall k1 (f :: k1 -> *). GHC.Internal.Generics.Generic1 (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Data.Semigroup.Internal’
-instance forall k1 (f :: k1 -> *). GHC.Internal.Generics.Generic1 (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Data.Monoid’
instance forall k (f :: k -> *) (g :: k -> *). GHC.Internal.Generics.Generic1 (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Generics’
instance forall k (f :: k -> *) (g :: k -> *). GHC.Internal.Generics.Generic1 (f GHC.Internal.Generics.:+: g) -- Defined in ‘GHC.Internal.Generics’
instance forall (f :: * -> *) k (g :: k -> *). GHC.Internal.Base.Functor f => GHC.Internal.Generics.Generic1 (f GHC.Internal.Generics.:.: g) -- Defined in ‘GHC.Internal.Generics’
+instance forall k (f :: k -> *). GHC.Internal.Generics.Generic1 (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Generics’
+instance forall k (f :: k -> *). GHC.Internal.Generics.Generic1 (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Generics’
+instance forall k a. GHC.Internal.Generics.Generic1 (GHC.Internal.Data.Functor.Const.Const a) -- Defined in ‘GHC.Internal.Generics’
instance forall k i c. GHC.Internal.Generics.Generic1 (GHC.Internal.Generics.K1 i c) -- Defined in ‘GHC.Internal.Generics’
instance forall i (c :: GHC.Internal.Generics.Meta) k (f :: k -> *). GHC.Internal.Generics.Generic1 (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Generics’
instance forall k. GHC.Internal.Generics.Generic1 GHC.Internal.Data.Proxy.Proxy -- Defined in ‘GHC.Internal.Generics’
@@ -12428,6 +12443,7 @@ instance forall a. GHC.Internal.Read.Read a => GHC.Internal.Read.Read (GHC.Inter
instance forall a. GHC.Internal.Read.Read a => GHC.Internal.Read.Read (GHC.Internal.Data.Bits.Xor a) -- Defined in ‘GHC.Internal.Data.Bits’
instance forall a b. (GHC.Internal.Ix.Ix a, GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => GHC.Internal.Read.Read (GHC.Internal.Arr.Array a b) -- Defined in ‘GHC.Internal.Read’
instance GHC.Internal.Read.Read GHC.Internal.Types.Bool -- Defined in ‘GHC.Internal.Read’
+instance GHC.Internal.Read.Read GHC.Internal.ByteOrder.ByteOrder -- Defined in ‘GHC.Internal.Read’
instance GHC.Internal.Read.Read GHC.Internal.Types.Char -- Defined in ‘GHC.Internal.Read’
instance GHC.Internal.Read.Read GHC.Internal.Types.Double -- Defined in ‘GHC.Internal.Read’
instance GHC.Internal.Read.Read GHC.Internal.Types.Float -- Defined in ‘GHC.Internal.Read’
@@ -12523,7 +12539,6 @@ instance GHC.Internal.Read.Read GHC.Internal.Foreign.C.Types.CULong -- Defined i
instance GHC.Internal.Read.Read GHC.Internal.Foreign.C.Types.CUSeconds -- Defined in ‘GHC.Internal.Foreign.C.Types’
instance GHC.Internal.Read.Read GHC.Internal.Foreign.C.Types.CUShort -- Defined in ‘GHC.Internal.Foreign.C.Types’
instance GHC.Internal.Read.Read GHC.Internal.Foreign.C.Types.CWchar -- Defined in ‘GHC.Internal.Foreign.C.Types’
-instance GHC.Internal.Read.Read GHC.Internal.ByteOrder.ByteOrder -- Defined in ‘GHC.Internal.ByteOrder’
instance forall k (f :: k -> *) (g :: k -> *) (p :: k). (GHC.Internal.Read.Read (f p), GHC.Internal.Read.Read (g p)) => GHC.Internal.Read.Read ((GHC.Internal.Generics.:*:) f g p) -- Defined in ‘GHC.Internal.Generics’
instance forall k (f :: k -> *) (g :: k -> *) (p :: k). (GHC.Internal.Read.Read (f p), GHC.Internal.Read.Read (g p)) => GHC.Internal.Read.Read ((GHC.Internal.Generics.:+:) f g p) -- Defined in ‘GHC.Internal.Generics’
instance forall k2 (f :: k2 -> *) k1 (g :: k1 -> k2) (p :: k1). GHC.Internal.Read.Read (f (g p)) => GHC.Internal.Read.Read ((GHC.Internal.Generics.:.:) f g p) -- Defined in ‘GHC.Internal.Generics’
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c937f7d9c993257d6aff609bf2f807…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c937f7d9c993257d6aff609bf2f807…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Simon Peyton Jones pushed to branch wip/T26868 at Glasgow Haskell Compiler / GHC
Commits:
b4a7ad4e by Simon Peyton Jones at 2026-02-20T11:45:52+00:00
Wibbles
- - - - -
2 changed files:
- compiler/GHC/Core/FVs.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
Changes:
=====================================
compiler/GHC/Core/FVs.hs
=====================================
@@ -27,7 +27,7 @@ module GHC.Core.FVs (
bndrTypeTyCoFVs, bndrFVs, dBndrFreeVars,
idUnfoldingVars, bndrFreeVars,
bndrRuleAndUnfoldingVarsDSet,
- bndrRuleAndUnfoldingIds,
+ bndrRuleAndUnfoldingVars,
idRuleVars, stableUnfoldingVars,
ruleFreeVars, rulesFreeVars,
rulesFreeVarsDSet, mkRuleInfo,
@@ -283,8 +283,8 @@ bndrFVs id = assert (isId id) $
bndrRuleAndUnfoldingVarsDSet :: Id -> DVarSet
bndrRuleAndUnfoldingVarsDSet = runFVSelective isLocalVar . bndrRuleAndUnfoldingFVs
-bndrRuleAndUnfoldingIds :: Id -> IdSet
-bndrRuleAndUnfoldingIds = dVarSetToVarSet . bndrRuleAndUnfoldingVarsDSet
+bndrRuleAndUnfoldingVars :: Id -> VarSet
+bndrRuleAndUnfoldingVars = dVarSetToVarSet . bndrRuleAndUnfoldingVarsDSet
bndrRuleAndUnfoldingFVs :: Id -> SelectiveFVRes
bndrRuleAndUnfoldingFVs id
=====================================
compiler/GHC/Core/Opt/DmdAnal.hs
=====================================
@@ -23,7 +23,7 @@ import GHC.Core.DataCon
import GHC.Core.Utils
import GHC.Core.TyCon
import GHC.Core.Type
-import GHC.Core.FVs ( rulesRhsFreeIds, bndrRuleAndUnfoldingIds )
+import GHC.Core.FVs ( rulesRhsFreeIds, bndrRuleAndUnfoldingVars )
import GHC.Core.Coercion ( Coercion )
import GHC.Core.TyCo.FVs ( coVarsOfCos )
import GHC.Core.TyCo.Compare ( eqType )
@@ -112,23 +112,27 @@ dmdAnalProgram opts fam_envs rules binds
-- orphan RULES
keep_alive_roots env ids = plusDmdEnvs (map (demandRoot env) (filter is_root ids))
- is_root :: Id -> Bool
- is_root id = isExportedId id || elemVarSet id rule_fvs
+ is_root :: Var -> Bool
+ is_root v = isId v && (isExportedId v || elemVarSet v rule_fvs)
rule_fvs :: IdSet
rule_fvs = rulesRhsFreeIds rules
demandRoot :: AnalEnv -> Id -> DmdEnv
-- See Note [Absence analysis for stable unfoldings and RULES]
-demandRoot env id = fst (dmdAnalStar env topDmd (Var id))
+demandRoot env id = assertPpr (isId id) (ppr id) $
+ fst (dmdAnalStar env topDmd (Var id))
-demandRoots :: AnalEnv -> [Id] -> DmdEnv
+demandRootSet :: AnalEnv -> VarSet -> DmdEnv
-- See Note [Absence analysis for stable unfoldings and RULES]
-demandRoots env roots = plusDmdEnvs (map (demandRoot env) roots)
+demandRootSet env ids
+ = nonDetStrictFoldVarSet do_one nopDmdEnv ids
+ -- It's OK to use a non-deterministic fold because plusDmdType is commutative
+ where
+ do_one :: Var -> DmdEnv -> DmdEnv
+ do_one v acc | not (isId v) = acc
+ | otherwise = demandRoot env v `plusDmdEnv` acc
-demandRootSet :: AnalEnv -> IdSet -> DmdEnv
-demandRootSet env ids = demandRoots env (nonDetEltsUniqSet ids)
- -- It's OK to use nonDetEltsUniqSet here because plusDmdType is commutative
-- | We attach useful (e.g. not 'topDmd') 'idDemandInfo' to top-level bindings
-- that satisfy this function.
@@ -353,7 +357,7 @@ dmdAnalBindLetUp top_lvl env id rhs anal_body = WithDmdType final_ty (R (NonRec
(rhs_ty, rhs') = dmdAnalStar env id_dmd' rhs
-- See Note [Absence analysis for stable unfoldings and RULES]
- rule_fvs = bndrRuleAndUnfoldingIds id
+ rule_fvs = bndrRuleAndUnfoldingVars id
final_ty = body_ty' `plusDmdType` rhs_ty `plusDmdType` demandRootSet env rule_fvs
-- | Let bindings can be processed in two ways:
@@ -1021,6 +1025,7 @@ dmdTransform env var sd
= -- pprTraceWith "dmdTransform:DataCon" (\ty -> ppr con $$ ppr sd $$ ppr ty) $
dmdTransformDataConSig (dataConRepStrictness con) sd
-- See Note [DmdAnal for DataCon wrappers]
+
| Just rhs <- dataConWrapUnfolding_maybe var
, WithDmdType dmd_ty _rhs' <- dmdAnal env sd rhs
= dmd_ty
@@ -1056,7 +1061,7 @@ dmdTransform env var sd
-- * Lambda binders
-- * Case and constructor field binders
| otherwise
- = -- pprTrace "dmdTransform:other" (vcat [ppr var, ppr boxity, ppr sd]) $
+ = -- pprTrace "dmdTransform:other" (vcat [ppr var, ppr sd]) $
noArgsDmdType (addVarDmdEnv nopDmdEnv var (C_11 :* sd))
{- *********************************************************************
@@ -1136,7 +1141,7 @@ dmdAnalRhsSig top_lvl rec_flag env let_sd id rhs
NonRecursive -> rhs_env
-- See Note [Absence analysis for stable unfoldings and RULES]
- rhs_env2 = rhs_env1 `plusDmdEnv` demandRootSet env (bndrRuleAndUnfoldingIds id)
+ rhs_env2 = rhs_env1 `plusDmdEnv` demandRootSet env (bndrRuleAndUnfoldingVars id)
-- See Note [Lazy and unleashable free variables]
!(!sig_env, !weak_fvs) = splitWeakDmds rhs_env2
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b4a7ad4eb590f51664872389616da38…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b4a7ad4eb590f51664872389616da38…
You're receiving this email because of your account on gitlab.haskell.org.
1
0