[Git][ghc/ghc][wip/romes/25513] base: displayException for SomeAsyncException

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Sat Dec 14 00:33:35 UTC 2024



Rodrigo Mesquita pushed to branch wip/romes/25513 at Glasgow Haskell Compiler / GHC


Commits:
62149da4 by Rodrigo Mesquita at 2024-12-14T00:33:10+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 (SomeExceptionException 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/62149da403d4ec7c1fb0765cfb0447e9f2fb0d25

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/62149da403d4ec7c1fb0765cfb0447e9f2fb0d25
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/20241213/4aba8cf4/attachment-0001.html>


More information about the ghc-commits mailing list