Haskell.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

ghc-commits

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
ghc-commits@haskell.org

  • 1 participants
  • 10850 discussions
[Git][ghc/ghc][wip/torsten.schmits/mwb-26-07/abstract-linkables] Haddock: backport latest incremental patch
by Torsten Schmits (@torsten.schmits) 13 Aug '26

13 Aug '26
Torsten Schmits pushed to branch wip/torsten.schmits/mwb-26-07/abstract-linkables at Glasgow Haskell Compiler / GHC Commits: 1767fddb by Torsten Schmits at 2026-08-12T18:29:17+02:00 Haddock: backport latest incremental patch - - - - - 2 changed files: - .gitmodules - utils/haddock Changes: ===================================== .gitmodules ===================================== @@ -93,9 +93,8 @@ ignore = untracked [submodule "utils/haddock"] path = utils/haddock - url = https://github.com/MercuryTechnologies/haddock.git + url = https://gitlab.haskell.org/ghc/haddock.git ignore = untracked - branch = mercury-ghc9101-20260729 [submodule "nofib"] path = nofib url = https://gitlab.haskell.org/ghc/nofib.git ===================================== utils/haddock ===================================== @@ -1 +1 @@ -Subproject commit a380001d4014c5d4bf27b9282e62277b53e03df7 +Subproject commit 7873a4d552e54a210198daf2334c1337ac7ea902 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1767fddbc7220c5535652838a4e2782… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1767fddbc7220c5535652838a4e2782… You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1 0
0 0
[Git][ghc/ghc][wip/torsten.schmits/mwb-26-07/abstract-linkables] Haddock: backport latest incremental patch
by Torsten Schmits (@torsten.schmits) 12 Aug '26

12 Aug '26
Torsten Schmits pushed to branch wip/torsten.schmits/mwb-26-07/abstract-linkables at Glasgow Haskell Compiler / GHC Commits: 58babe91 by Torsten Schmits at 2026-08-12T17:52:18+02:00 Haddock: backport latest incremental patch - - - - - 1 changed file: - utils/haddock Changes: ===================================== utils/haddock ===================================== @@ -1 +1 @@ -Subproject commit a380001d4014c5d4bf27b9282e62277b53e03df7 +Subproject commit 7873a4d552e54a210198daf2334c1337ac7ea902 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/58babe912774bff3e3e40bf96ddc9cb… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/58babe912774bff3e3e40bf96ddc9cb… You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1 0
0 0
[Git][ghc/ghc][wip/jeltsch/stm-exception-improvements] Add `rethrowSTM` and improve STM-related documentation
by Wolfgang Jeltsch (@jeltsch) 12 Aug '26

12 Aug '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/stm-exception-improvements at Glasgow Haskell Compiler / GHC Commits: 3731b23a by Wolfgang Jeltsch at 2026-08-12T17:20:52+03:00 Add `rethrowSTM` and improve STM-related documentation Adding `rethrowSTM` resolves #26758. The implementation of `rethrowSTM` is completely analogous to the one of `rethrowIO`. The following is established for the documentation of `throwSTM` and `catchSTM`: * Both operations are directly described as analogs of their `IO` counterparts. * There is no reference to `throw` in the documentation of `throwSTM`, because, although such a reference is great in the documentation of `throwIO`, it is somewhat out of place in the documentation of `throwSTM`. * Instead of repeating part of `throwIO`’s documentation, the documentation of `throwSTM` just recommends using `throwSTM` instead of `throw` and references the corresponding arguments in the documentation of `throwIO`. - - - - - 6 changed files: - + changelog.d/rethrow-stm - libraries/base/src/GHC/Conc.hs - libraries/ghc-internal/src/GHC/Internal/STM.hs - 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 Changes: ===================================== changelog.d/rethrow-stm ===================================== @@ -0,0 +1,4 @@ +section: ghc-internal +synopsis: Add `rethrowSTM`, an `STM` analog of `rethrowIO` +issues: #26758 +mrs: !16501 ===================================== libraries/base/src/GHC/Conc.hs ===================================== @@ -79,6 +79,9 @@ module GHC.Conc , retry , orElse , throwSTM +#if __GLASGOW_HASKELL__ >= 1000 + , rethrowSTM +#endif , catchSTM , TVar(..) , newTVar ===================================== libraries/ghc-internal/src/GHC/Internal/STM.hs ===================================== @@ -3,6 +3,7 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} +{-# OPTIONS_GHC -Wno-unused-imports #-} {-# OPTIONS_HADDOCK not-home #-} module GHC.Internal.STM @@ -13,6 +14,7 @@ module GHC.Internal.STM , retry , orElse , throwSTM + , rethrowSTM , catchSTM , unsafeIOToSTM -- * TVars @@ -31,7 +33,9 @@ import GHC.Internal.Base ( import GHC.Internal.Classes (Eq(..)) import GHC.Internal.Exception (Exception, toExceptionWithBacktrace, fromException, addExceptionContext) import GHC.Internal.Exception.Context (ExceptionAnnotation) -import GHC.Internal.Exception.Type (WhileHandling(..)) +import GHC.Internal.Exception.Type ( + WhileHandling(..), ExceptionWithContext, NoBacktrace (NoBacktrace), + ) import GHC.Internal.Maybe (Maybe(..)) import GHC.Internal.Prim ( RealWorld, State#, TVar#, atomically#, catch#, catchRetry#, catchSTM#, @@ -41,6 +45,10 @@ import GHC.Internal.Prim.PtrEq (sameTVar#) import GHC.Internal.Stack (HasCallStack, withFrozenCallStack) import GHC.Internal.Types (IO(..), isTrue#) +-- Imports for documentation hyperlinking +import GHC.Internal.Exception (throw) +import GHC.Internal.IO (throwIO, rethrowIO) + -- TVars are shared memory locations which support atomic memory -- transactions. @@ -170,7 +178,7 @@ retry = STM $ \s# -> retry# s# orElse :: STM a -> STM a -> STM a orElse (STM m) e = STM $ \s -> catchRetry# m (unSTM e) s --- | A variant of 'throw' that can only be used within the 'STM' monad. +-- | The 'STM' analog of 'throwIO'. -- -- Throwing an exception in @STM@ aborts the transaction and propagates the -- exception. If the exception is caught via 'catchSTM', only the changes @@ -180,19 +188,8 @@ orElse (STM m) e = STM $ \s -> catchRetry# m (unSTM e) s -- If the exception is not caught inside of the 'STM', it is re-thrown by -- 'atomically', and the entire 'STM' is rolled back. -- --- Although 'throwSTM' has a type that is an instance of the type of 'throw', the --- two functions are subtly different: --- --- > throw e `seq` x ===> throw e --- > throwSTM e `seq` x ===> x --- --- The first example will cause the exception @e@ to be raised, --- whereas the second one won\'t. In fact, 'throwSTM' will only cause --- an exception to be raised when it is used within the 'STM' monad. --- The 'throwSTM' variant should be used in preference to 'throw' to --- raise an exception within the 'STM' monad because it guarantees --- ordering with respect to other 'STM' operations, whereas 'throw' --- does not. +-- Note that 'throwSTM' is preferable to 'throw', for the same reasons that +-- 'throwIO' is preferable to 'throw'. throwSTM :: (HasCallStack, Exception e) => e -> STM a throwSTM e = do -- N.B. Typically use of unsafeIOToSTM is very much frowned upon as this @@ -201,7 +198,11 @@ throwSTM e = do se <- unsafeIOToSTM (withFrozenCallStack $ toExceptionWithBacktrace e) STM $ raiseIO# se --- | Exception handling within STM actions. +-- | The 'STM' analog of 'rethrowIO'. +rethrowSTM :: Exception e => ExceptionWithContext e -> STM a +rethrowSTM e = throwSTM (NoBacktrace e) + +-- | The 'STM' analog of 'catch'. -- -- @'catchSTM' m f@ catches any exception thrown by @m@ using 'throwSTM', -- using the function @f@ to handle the exception. If an exception is ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -5135,6 +5135,7 @@ module GHC.Conc where reportError :: GHC.Internal.Exception.Type.SomeException -> GHC.Internal.Types.IO () reportHeapOverflow :: GHC.Internal.Types.IO () reportStackOverflow :: GHC.Internal.Types.IO () + rethrowSTM :: forall e a. GHC.Internal.Exception.Type.Exception e => GHC.Internal.Exception.Type.ExceptionWithContext e -> STM a retry :: forall a. STM a runHandlers :: GHC.Internal.ForeignPtr.ForeignPtr GHC.Internal.Word.Word8 -> Signal -> GHC.Internal.Types.IO () runSparks :: GHC.Internal.Types.IO () ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -5135,6 +5135,7 @@ module GHC.Conc where reportError :: GHC.Internal.Exception.Type.SomeException -> GHC.Internal.Types.IO () reportHeapOverflow :: GHC.Internal.Types.IO () reportStackOverflow :: GHC.Internal.Types.IO () + rethrowSTM :: forall e a. GHC.Internal.Exception.Type.Exception e => GHC.Internal.Exception.Type.ExceptionWithContext e -> STM a retry :: forall a. STM a runHandlers :: GHC.Internal.ForeignPtr.ForeignPtr GHC.Internal.Word.Word8 -> Signal -> GHC.Internal.Types.IO () runSparks :: GHC.Internal.Types.IO () ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -5141,6 +5141,7 @@ module GHC.Conc where reportError :: GHC.Internal.Exception.Type.SomeException -> GHC.Internal.Types.IO () reportHeapOverflow :: GHC.Internal.Types.IO () reportStackOverflow :: GHC.Internal.Types.IO () + rethrowSTM :: forall e a. GHC.Internal.Exception.Type.Exception e => GHC.Internal.Exception.Type.ExceptionWithContext e -> STM a retry :: forall a. STM a runSparks :: GHC.Internal.Types.IO () setAllocationCounter :: GHC.Internal.Int.Int64 -> GHC.Internal.Types.IO () View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3731b23a08216bbff8d7eadf8b38040… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3731b23a08216bbff8d7eadf8b38040… You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1 0
0 0
[Git][ghc/ghc][wip/jeltsch/ghc-9-14-building-base] Move the definition of `withEmptyCallStack` into `base`
by Wolfgang Jeltsch (@jeltsch) 12 Aug '26

12 Aug '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/ghc-9-14-building-base at Glasgow Haskell Compiler / GHC Commits: 952f9965 by Wolfgang Jeltsch at 2026-08-12T16:33:25+03:00 Move the definition of `withEmptyCallStack` into `base` - - - - - 2 changed files: - libraries/base/src/GHC/Stack.hs - libraries/ghc-internal/src/GHC/Internal/Stack.hs Changes: ===================================== libraries/base/src/GHC/Stack.hs ===================================== @@ -1,5 +1,8 @@ {-# LANGUAGE Safe #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ImplicitParams #-} + -- | -- -- Module : GHC.Stack @@ -51,3 +54,20 @@ module GHC.Stack ) where import GHC.Internal.Stack + +-- | Explicitly bring the empty call stack into scope. +-- +-- Mostly useful for silencing warnings generated by @-Wdefaulted-callstack@ in +-- places such as: +-- +-- - The body of a class method in an instance of an externally defined type +-- class whose type signature doesn't contain a 'HasCallStack' constraint. +-- +-- - The body of the @main@ function. +-- +-- @since 4.24.0.0 +withEmptyCallStack :: (HasCallStack => a) -> a +withEmptyCallStack do_this = + -- See Note [Warn about defaulted CallStacks] + let ?callStack = emptyCallStack + in do_this ===================================== libraries/ghc-internal/src/GHC/Internal/Stack.hs ===================================== @@ -29,7 +29,7 @@ module GHC.Internal.Stack ( -- * HasCallStack call stacks CallStack, HasCallStack, callStack, emptyCallStack, freezeCallStack, fromCallSiteList, getCallStack, popCallStack, - pushCallStack, withFrozenCallStack, withEmptyCallStack, + pushCallStack, withFrozenCallStack, prettyCallStackLines, prettyCallStack, -- * Source locations @@ -105,23 +105,6 @@ withFrozenCallStack do_this = let ?callStack = freezeCallStack (popCallStack callStack) in do_this --- | Explicitly bring the empty call stack into scope. --- --- Mostly useful for silencing warnings generated by @-Wdefaulted-callstack@ in --- places such as: --- --- - The body of a class method in an instance of an externally defined type --- class whose type signature doesn't contain a 'HasCallStack' constraint. --- --- - The body of the @main@ function. --- --- @since 4.24.0.0 -withEmptyCallStack :: (HasCallStack => a) -> a -withEmptyCallStack do_this = - -- See Note [Warn about defaulted CallStacks] - let ?callStack = emptyCallStack - in do_this - -- prettySrcLoc and prettyCallStack are defined here to avoid hs-boot -- files. See Note [Definition of CallStack] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/952f9965916aa952d7d129f0a0b108f… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/952f9965916aa952d7d129f0a0b108f… You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1 0
0 0
[Git][ghc/ghc][wip/mangoiv/ci-stages] revert: don't run stage1 tests
by Magnus (@MangoIV) 12 Aug '26

12 Aug '26
Magnus pushed to branch wip/mangoiv/ci-stages at Glasgow Haskell Compiler / GHC Commits: b6b6ab73 by mangoiv at 2026-08-12T14:29:36+02:00 revert: don't run stage1 tests - - - - - 1 changed file: - .gitlab/ci.sh Changes: ===================================== .gitlab/ci.sh ===================================== @@ -735,16 +735,16 @@ function test_hadrian() { local test_compiler="$instdir/bin/${cross_prefix}ghc$exe" install_bindist $dist_dir/ghc-*/ "$instdir" - if [[ "${CI_JOB_NAME}" != *"windows"* ]] && [ -z "${CROSS_TARGET:-}" ] - then - run_hadrian \ - test \ - --test-root-dirs=testsuite/tests/stage1 \ - --test-compiler=stage1 \ - ${TEST_WAYS[@]/#/--test-way=} \ - "runtest.opts+=${RUNTEST_ARGS:-}" || fail "hadrian stage1 test" - info "STAGE1_TEST=$?" - fi + # if [[ "${CI_JOB_NAME}" != *"windows"* ]] && [ -z "${CROSS_TARGET:-}" ] + # then + # run_hadrian \ + # test \ + # --test-root-dirs=testsuite/tests/stage1 \ + # --test-compiler=stage1 \ + # ${TEST_WAYS[@]/#/--test-way=} \ + # "runtest.opts+=${RUNTEST_ARGS:-}" || fail "hadrian stage1 test" + # info "STAGE1_TEST=$?" + # fi # Ensure the resulting compiler has the correct bignum-flavour, # except for cross-compilers as they may not support the interpreter View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b6b6ab736bf26a2d413c6a28288a013… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b6b6ab736bf26a2d413c6a28288a013… You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1 0
0 0
[Git][ghc/ghc][wip/27657] ghc-internal: annotateSTM should use catchSTM# rather than catch#
by Zubin (@wz1000) 12 Aug '26

12 Aug '26
Zubin pushed to branch wip/27657 at Glasgow Haskell Compiler / GHC Commits: e01c6711 by Zubin Duggal at 2026-08-12T17:55:53+05:30 ghc-internal: annotateSTM should use catchSTM# rather than catch# A catch# frame inside a transaction breaks retry and async exception delivery. Fixes #27657 - - - - - 7 changed files: - + changelog.d/T27657 - libraries/ghc-internal/src/GHC/Internal/STM.hs - + testsuite/tests/concurrent/should_run/T27657a.hs - + testsuite/tests/concurrent/should_run/T27657a.stdout - + testsuite/tests/concurrent/should_run/T27657b.hs - + testsuite/tests/concurrent/should_run/T27657b.stdout - testsuite/tests/concurrent/should_run/all.T Changes: ===================================== changelog.d/T27657 ===================================== @@ -0,0 +1,9 @@ +section: base +issues: #27657 +mrs: !16508 +synopsis: + Fix ``retry`` and async exception delivery inside a ``catchSTM`` handler +description: + ``catchSTM``\'s ``WhileHandling`` annotation used ``catch#``, leaving an IO + ``CATCH_FRAME`` inside the transaction. Use ``catchSTM#``, which is the + correct way to catch exceptions inside STM. ===================================== libraries/ghc-internal/src/GHC/Internal/STM.hs ===================================== @@ -34,7 +34,7 @@ import GHC.Internal.Exception.Context (ExceptionAnnotation) import GHC.Internal.Exception.Type (WhileHandling(..)) import GHC.Internal.Maybe (Maybe(..)) import GHC.Internal.Prim ( - RealWorld, State#, TVar#, atomically#, catch#, catchRetry#, catchSTM#, + RealWorld, State#, TVar#, atomically#, catchRetry#, catchSTM#, newTVar#, raiseIO#, readTVar#, readTVarIO#, retry#, writeTVar#, ) import GHC.Internal.Prim.PtrEq (sameTVar#) @@ -217,7 +217,7 @@ catchSTM (STM m) handler = STM $ catchSTM# m handler' -- | Execute an 'STM' action, adding the given 'ExceptionContext' -- to any thrown synchronous exceptions. annotateSTM :: forall e a. ExceptionAnnotation e => e -> STM a -> STM a -annotateSTM ann (STM io) = STM (catch# io handler) +annotateSTM ann (STM io) = STM (catchSTM# io handler) -- not catch#, see #27657 where handler se = raiseIO# (addExceptionContext ann se) ===================================== testsuite/tests/concurrent/should_run/T27657a.hs ===================================== @@ -0,0 +1,15 @@ +{-# LANGUAGE ScopedTypeVariables #-} + +-- A retry escaping a catchSTM handler must reach the enclosing orElse. An IO +-- CATCH_FRAME in the way trips an assertion in findRetryFrameHelper. + +import Control.Exception +import GHC.Conc + +main :: IO () +main = do + r <- atomically $ + catchSTM (throwSTM (ErrorCall "boom")) + (\(_ :: SomeException) -> retry) + `orElse` pure "T27657a: completed" + putStrLn r ===================================== testsuite/tests/concurrent/should_run/T27657a.stdout ===================================== @@ -0,0 +1 @@ +T27657a: completed ===================================== testsuite/tests/concurrent/should_run/T27657b.hs ===================================== @@ -0,0 +1,40 @@ +{-# LANGUAGE ScopedTypeVariables #-} + +-- An async exception delivered while a catchSTM handler runs must abort the +-- transaction, not be swallowed by a restart of the invalidated one. + +import Control.Concurrent.MVar +import Control.Exception +import GHC.Conc + +waitParked :: ThreadId -> IO () +waitParked t = do + s <- threadStatus t + case s of + ThreadBlocked BlockedOnMVar -> pure () + _ -> threadDelay 1000 >> waitParked t + +main :: IO () +main = do + tv <- newTVarIO (0 :: Int) + park <- newEmptyMVar + result <- newEmptyMVar + t <- forkIO $ do + r <- try $ atomically $ do + v <- readTVar tv + catchSTM (throwSTM (ErrorCall "boom")) + (\(_ :: SomeException) -> + if v == 0 + then do unsafeIOToSTM (takeMVar park) + pure "handler resumed" + else pure "transaction restarted, exception dropped") + putMVar result (r :: Either SomeException String) + -- parked in the handler, so t cannot revalidate its trec before delivery + waitParked t + atomically (writeTVar tv 1) + killThread t + r <- takeMVar result + putStrLn $ case r of + Left e | Just ThreadKilled <- fromException e -> "T27657b: killThread delivered" + | otherwise -> "T27657b: unexpected exception: " ++ displayException e + Right s -> "T27657b: FAILED, " ++ s ===================================== testsuite/tests/concurrent/should_run/T27657b.stdout ===================================== @@ -0,0 +1 @@ +T27657b: killThread delivered ===================================== testsuite/tests/concurrent/should_run/all.T ===================================== @@ -338,3 +338,6 @@ test('T27105_fail', extra_run_opts('+RTS -C0.2 -RTS'), expect_fail, run_timeout_multiplier(0.05)], multimod_compile_and_run, ['T27105.hs', '']) + +test('T27657a', normal, compile_and_run, ['']) +test('T27657b', normal, compile_and_run, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e01c6711c7e71998d6b1430ea3cdd0c… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e01c6711c7e71998d6b1430ea3cdd0c… You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1 0
0 0
[Git][ghc/ghc][wip/jeltsch/stm-exception-improvements] Add `rethrowSTM` and improve STM-related documentation
by Wolfgang Jeltsch (@jeltsch) 12 Aug '26

12 Aug '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/stm-exception-improvements at Glasgow Haskell Compiler / GHC Commits: 45cb5d1b by Wolfgang Jeltsch at 2026-08-12T14:15:13+03:00 Add `rethrowSTM` and improve STM-related documentation Adding `rethrowSTM` resolves #26758. The implementation of `rethrowSTM` is completely analogous to the one of `rethrowIO`. The following is established for the documentation of `throwSTM` and `catchSTM`: * Both operations are directly described as analogs of their `IO` counterparts. * There is no reference to `throw` in the documentation of `throwSTM`, because, although such a reference is great in the documentation of `throwIO`, it is somewhat out of place in the documentation of `throwSTM`. * Instead of repeating part of `throwIO`’s documentation, the documentation of `throwSTM` just recommends using `throwSTM` instead of `throw` and references the corresponding arguments in the documentation of `throwIO`. - - - - - 6 changed files: - + changelog.d/rethrow-stm - libraries/base/src/GHC/Conc.hs - libraries/ghc-internal/src/GHC/Internal/STM.hs - 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 Changes: ===================================== changelog.d/rethrow-stm ===================================== @@ -0,0 +1,4 @@ +section: ghc-internal +synopsis: Add `rethrowSTM`, an `STM` analog of `rethrowIO` +issues: #26758 +mrs: !16501 ===================================== libraries/base/src/GHC/Conc.hs ===================================== @@ -79,6 +79,9 @@ module GHC.Conc , retry , orElse , throwSTM +#if __GLASGOW_HASKELL__ >= 1000 + , rethrowSTM +#endif , catchSTM , TVar(..) , newTVar ===================================== libraries/ghc-internal/src/GHC/Internal/STM.hs ===================================== @@ -13,6 +13,7 @@ module GHC.Internal.STM , retry , orElse , throwSTM + , rethrowSTM , catchSTM , unsafeIOToSTM -- * TVars @@ -31,7 +32,9 @@ import GHC.Internal.Base ( import GHC.Internal.Classes (Eq(..)) import GHC.Internal.Exception (Exception, toExceptionWithBacktrace, fromException, addExceptionContext) import GHC.Internal.Exception.Context (ExceptionAnnotation) -import GHC.Internal.Exception.Type (WhileHandling(..)) +import GHC.Internal.Exception.Type ( + WhileHandling(..), ExceptionWithContext, NoBacktrace (NoBacktrace), + ) import GHC.Internal.Maybe (Maybe(..)) import GHC.Internal.Prim ( RealWorld, State#, TVar#, atomically#, catch#, catchRetry#, catchSTM#, @@ -170,7 +173,7 @@ retry = STM $ \s# -> retry# s# orElse :: STM a -> STM a -> STM a orElse (STM m) e = STM $ \s -> catchRetry# m (unSTM e) s --- | A variant of 'throw' that can only be used within the 'STM' monad. +-- | The 'STM' analog of 'throwIO'. -- -- Throwing an exception in @STM@ aborts the transaction and propagates the -- exception. If the exception is caught via 'catchSTM', only the changes @@ -180,19 +183,8 @@ orElse (STM m) e = STM $ \s -> catchRetry# m (unSTM e) s -- If the exception is not caught inside of the 'STM', it is re-thrown by -- 'atomically', and the entire 'STM' is rolled back. -- --- Although 'throwSTM' has a type that is an instance of the type of 'throw', the --- two functions are subtly different: --- --- > throw e `seq` x ===> throw e --- > throwSTM e `seq` x ===> x --- --- The first example will cause the exception @e@ to be raised, --- whereas the second one won\'t. In fact, 'throwSTM' will only cause --- an exception to be raised when it is used within the 'STM' monad. --- The 'throwSTM' variant should be used in preference to 'throw' to --- raise an exception within the 'STM' monad because it guarantees --- ordering with respect to other 'STM' operations, whereas 'throw' --- does not. +-- Note that 'throwSTM' is preferable to 'throw', for the same +-- [reasons]('throwIO') that 'throwIO' is preferable to 'throw'. throwSTM :: (HasCallStack, Exception e) => e -> STM a throwSTM e = do -- N.B. Typically use of unsafeIOToSTM is very much frowned upon as this @@ -201,7 +193,11 @@ throwSTM e = do se <- unsafeIOToSTM (withFrozenCallStack $ toExceptionWithBacktrace e) STM $ raiseIO# se --- | Exception handling within STM actions. +-- | The 'STM' analog of 'rethrowIO'. +rethrowSTM :: Exception e => ExceptionWithContext e -> STM a +rethrowSTM e = throwSTM (NoBacktrace e) + +-- | The 'STM' analog of 'catchIO'. -- -- @'catchSTM' m f@ catches any exception thrown by @m@ using 'throwSTM', -- using the function @f@ to handle the exception. If an exception is ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -5135,6 +5135,7 @@ module GHC.Conc where reportError :: GHC.Internal.Exception.Type.SomeException -> GHC.Internal.Types.IO () reportHeapOverflow :: GHC.Internal.Types.IO () reportStackOverflow :: GHC.Internal.Types.IO () + rethrowSTM :: forall e a. GHC.Internal.Exception.Type.Exception e => GHC.Internal.Exception.Type.ExceptionWithContext e -> STM a retry :: forall a. STM a runHandlers :: GHC.Internal.ForeignPtr.ForeignPtr GHC.Internal.Word.Word8 -> Signal -> GHC.Internal.Types.IO () runSparks :: GHC.Internal.Types.IO () ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -5135,6 +5135,7 @@ module GHC.Conc where reportError :: GHC.Internal.Exception.Type.SomeException -> GHC.Internal.Types.IO () reportHeapOverflow :: GHC.Internal.Types.IO () reportStackOverflow :: GHC.Internal.Types.IO () + rethrowSTM :: forall e a. GHC.Internal.Exception.Type.Exception e => GHC.Internal.Exception.Type.ExceptionWithContext e -> STM a retry :: forall a. STM a runHandlers :: GHC.Internal.ForeignPtr.ForeignPtr GHC.Internal.Word.Word8 -> Signal -> GHC.Internal.Types.IO () runSparks :: GHC.Internal.Types.IO () ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -5141,6 +5141,7 @@ module GHC.Conc where reportError :: GHC.Internal.Exception.Type.SomeException -> GHC.Internal.Types.IO () reportHeapOverflow :: GHC.Internal.Types.IO () reportStackOverflow :: GHC.Internal.Types.IO () + rethrowSTM :: forall e a. GHC.Internal.Exception.Type.Exception e => GHC.Internal.Exception.Type.ExceptionWithContext e -> STM a retry :: forall a. STM a runSparks :: GHC.Internal.Types.IO () setAllocationCounter :: GHC.Internal.Int.Int64 -> GHC.Internal.Types.IO () View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/45cb5d1bc9a01a82882f7ec3387511c… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/45cb5d1bc9a01a82882f7ec3387511c… You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1 0
0 0
[Git][ghc/ghc][wip/jeltsch/ghc-9-14-building-base] Move the definition of `withEmptyCallStack` into `base`
by Wolfgang Jeltsch (@jeltsch) 12 Aug '26

12 Aug '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/ghc-9-14-building-base at Glasgow Haskell Compiler / GHC Commits: c374d64f by Wolfgang Jeltsch at 2026-08-12T14:01:37+03:00 Move the definition of `withEmptyCallStack` into `base` - - - - - 2 changed files: - libraries/base/src/GHC/Stack.hs - libraries/ghc-internal/src/GHC/Internal/Stack.hs Changes: ===================================== libraries/base/src/GHC/Stack.hs ===================================== @@ -51,3 +51,20 @@ module GHC.Stack ) where import GHC.Internal.Stack + +-- | Explicitly bring the empty call stack into scope. +-- +-- Mostly useful for silencing warnings generated by @-Wdefaulted-callstack@ in +-- places such as: +-- +-- - The body of a class method in an instance of an externally defined type +-- class whose type signature doesn't contain a 'HasCallStack' constraint. +-- +-- - The body of the @main@ function. +-- +-- @since 4.24.0.0 +withEmptyCallStack :: (HasCallStack => a) -> a +withEmptyCallStack do_this = + -- See Note [Warn about defaulted CallStacks] + let ?callStack = emptyCallStack + in do_this ===================================== libraries/ghc-internal/src/GHC/Internal/Stack.hs ===================================== @@ -29,7 +29,7 @@ module GHC.Internal.Stack ( -- * HasCallStack call stacks CallStack, HasCallStack, callStack, emptyCallStack, freezeCallStack, fromCallSiteList, getCallStack, popCallStack, - pushCallStack, withFrozenCallStack, withEmptyCallStack, + pushCallStack, withFrozenCallStack, prettyCallStackLines, prettyCallStack, -- * Source locations @@ -105,23 +105,6 @@ withFrozenCallStack do_this = let ?callStack = freezeCallStack (popCallStack callStack) in do_this --- | Explicitly bring the empty call stack into scope. --- --- Mostly useful for silencing warnings generated by @-Wdefaulted-callstack@ in --- places such as: --- --- - The body of a class method in an instance of an externally defined type --- class whose type signature doesn't contain a 'HasCallStack' constraint. --- --- - The body of the @main@ function. --- --- @since 4.24.0.0 -withEmptyCallStack :: (HasCallStack => a) -> a -withEmptyCallStack do_this = - -- See Note [Warn about defaulted CallStacks] - let ?callStack = emptyCallStack - in do_this - -- prettySrcLoc and prettyCallStack are defined here to avoid hs-boot -- files. See Note [Definition of CallStack] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c374d64f1006bc919abb91641bde9b6… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c374d64f1006bc919abb91641bde9b6… You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1 0
0 0
[Git][ghc/ghc][wip/jeltsch/stm-exception-improvements] Deleted 1 commit: Move the definition of `withEmptyCallStack` into `base`
by Wolfgang Jeltsch (@jeltsch) 12 Aug '26

12 Aug '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/stm-exception-improvements at Glasgow Haskell Compiler / GHC WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below. Deleted commits: f58e015b by Wolfgang Jeltsch at 2026-08-12T13:57:10+03:00 Move the definition of `withEmptyCallStack` into `base` - - - - - 2 changed files: - libraries/base/src/GHC/Stack.hs - libraries/ghc-internal/src/GHC/Internal/Stack.hs Changes: ===================================== libraries/base/src/GHC/Stack.hs ===================================== @@ -51,3 +51,20 @@ module GHC.Stack ) where import GHC.Internal.Stack + +-- | Explicitly bring the empty call stack into scope. +-- +-- Mostly useful for silencing warnings generated by @-Wdefaulted-callstack@ in +-- places such as: +-- +-- - The body of a class method in an instance of an externally defined type +-- class whose type signature doesn't contain a 'HasCallStack' constraint. +-- +-- - The body of the @main@ function. +-- +-- @since 4.24.0.0 +withEmptyCallStack :: (HasCallStack => a) -> a +withEmptyCallStack do_this = + -- See Note [Warn about defaulted CallStacks] + let ?callStack = emptyCallStack + in do_this ===================================== libraries/ghc-internal/src/GHC/Internal/Stack.hs ===================================== @@ -29,7 +29,7 @@ module GHC.Internal.Stack ( -- * HasCallStack call stacks CallStack, HasCallStack, callStack, emptyCallStack, freezeCallStack, fromCallSiteList, getCallStack, popCallStack, - pushCallStack, withFrozenCallStack, withEmptyCallStack, + pushCallStack, withFrozenCallStack, prettyCallStackLines, prettyCallStack, -- * Source locations @@ -105,23 +105,6 @@ withFrozenCallStack do_this = let ?callStack = freezeCallStack (popCallStack callStack) in do_this --- | Explicitly bring the empty call stack into scope. --- --- Mostly useful for silencing warnings generated by @-Wdefaulted-callstack@ in --- places such as: --- --- - The body of a class method in an instance of an externally defined type --- class whose type signature doesn't contain a 'HasCallStack' constraint. --- --- - The body of the @main@ function. --- --- @since 4.24.0.0 -withEmptyCallStack :: (HasCallStack => a) -> a -withEmptyCallStack do_this = - -- See Note [Warn about defaulted CallStacks] - let ?callStack = emptyCallStack - in do_this - -- prettySrcLoc and prettyCallStack are defined here to avoid hs-boot -- files. See Note [Definition of CallStack] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f58e015b702c17bf6c44f6b414f0513… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f58e015b702c17bf6c44f6b414f0513… You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1 0
0 0
[Git][ghc/ghc][wip/jeltsch/stm-exception-improvements] Move the definition of `withEmptyCallStack` into `base`
by Wolfgang Jeltsch (@jeltsch) 12 Aug '26

12 Aug '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/stm-exception-improvements at Glasgow Haskell Compiler / GHC Commits: f58e015b by Wolfgang Jeltsch at 2026-08-12T13:57:10+03:00 Move the definition of `withEmptyCallStack` into `base` - - - - - 2 changed files: - libraries/base/src/GHC/Stack.hs - libraries/ghc-internal/src/GHC/Internal/Stack.hs Changes: ===================================== libraries/base/src/GHC/Stack.hs ===================================== @@ -51,3 +51,20 @@ module GHC.Stack ) where import GHC.Internal.Stack + +-- | Explicitly bring the empty call stack into scope. +-- +-- Mostly useful for silencing warnings generated by @-Wdefaulted-callstack@ in +-- places such as: +-- +-- - The body of a class method in an instance of an externally defined type +-- class whose type signature doesn't contain a 'HasCallStack' constraint. +-- +-- - The body of the @main@ function. +-- +-- @since 4.24.0.0 +withEmptyCallStack :: (HasCallStack => a) -> a +withEmptyCallStack do_this = + -- See Note [Warn about defaulted CallStacks] + let ?callStack = emptyCallStack + in do_this ===================================== libraries/ghc-internal/src/GHC/Internal/Stack.hs ===================================== @@ -29,7 +29,7 @@ module GHC.Internal.Stack ( -- * HasCallStack call stacks CallStack, HasCallStack, callStack, emptyCallStack, freezeCallStack, fromCallSiteList, getCallStack, popCallStack, - pushCallStack, withFrozenCallStack, withEmptyCallStack, + pushCallStack, withFrozenCallStack, prettyCallStackLines, prettyCallStack, -- * Source locations @@ -105,23 +105,6 @@ withFrozenCallStack do_this = let ?callStack = freezeCallStack (popCallStack callStack) in do_this --- | Explicitly bring the empty call stack into scope. --- --- Mostly useful for silencing warnings generated by @-Wdefaulted-callstack@ in --- places such as: --- --- - The body of a class method in an instance of an externally defined type --- class whose type signature doesn't contain a 'HasCallStack' constraint. --- --- - The body of the @main@ function. --- --- @since 4.24.0.0 -withEmptyCallStack :: (HasCallStack => a) -> a -withEmptyCallStack do_this = - -- See Note [Warn about defaulted CallStacks] - let ?callStack = emptyCallStack - in do_this - -- prettySrcLoc and prettyCallStack are defined here to avoid hs-boot -- files. See Note [Definition of CallStack] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f58e015b702c17bf6c44f6b414f0513… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f58e015b702c17bf6c44f6b414f0513… You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • ...
  • 1085
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.