[Git][ghc/ghc][master] base: displayException for SomeAsyncException

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sun Dec 15 03:29:07 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
8658fbc1 by Rodrigo Mesquita at 2024-12-14T22:28:41-05: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/8658fbc15fa2d73636eeca0b75848e61091d7960

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8658fbc15fa2d73636eeca0b75848e61091d7960
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/95a61c91/attachment-0001.html>


More information about the ghc-commits mailing list