[Git][ghc/ghc][wip/romes/25513] base: displayException for SomeAsyncException
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Sat Dec 14 10:34:00 UTC 2024
Rodrigo Mesquita pushed to branch wip/romes/25513 at Glasgow Haskell Compiler / GHC
Commits:
033ef48d by Rodrigo Mesquita at 2024-12-14T10:33:39+00:00
base: displayException for SomeAsyncException
Provide a better implementation of `SomeException` for
`SomeAsyncException`.
The previous, implicit, implementation, would not use the
`displayException` of the exception wrapped by `SomeAsyncException`.
Implements CLC-Proposal#309
Closes #25513
- - - - -
2 changed files:
- libraries/base/changelog.md
- libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs
Changes:
=====================================
libraries/base/changelog.md
=====================================
@@ -1,6 +1,8 @@
# Changelog for [`base` package](http://hackage.haskell.org/package/base)
## 4.22.0.0 *TBA*
+ * Define `displayException` of `SomeAsyncException` to unwrap the exception.
+ ([CLC proposal #309](https://github.com/haskell/core-libraries-committee/issues/309))
* Restrict `Data.List.NonEmpty.unzip` to `NonEmpty (a, b) -> (NonEmpty a, NonEmpty b)`. ([CLC proposal #86](https://github.com/haskell/core-libraries-committee/issues/86))
* Modify the implementation of `Control.Exception.throw` to avoid call-sites being inferred as diverging via precise exception.
([GHC #25066](https://gitlab.haskell.org/ghc/ghc/-/issues/25066), [CLC proposal #290](https://github.com/haskell/core-libraries-committee/issues/290))
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs
=====================================
@@ -187,7 +187,8 @@ instance Show SomeAsyncException where
showsPrec p (SomeAsyncException e) = showsPrec p e
-- | @since base-4.7.0.0
-instance Exception SomeAsyncException
+instance Exception SomeAsyncException where
+ displayException (SomeAsyncException e) = displayException e
-- | @since base-4.7.0.0
asyncExceptionToException :: Exception e => e -> SomeException
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/033ef48d0d846ec9cbffb8808fef57967015c23a
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/033ef48d0d846ec9cbffb8808fef57967015c23a
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241214/eb3719c5/attachment-0001.html>
More information about the ghc-commits
mailing list