[Git][ghc/ghc][wip/romes/edsko-exceptions-2] 2 commits: docs: toException shouldn't insist on empty context
Rodrigo Mesquita pushed to branch wip/romes/edsko-exceptions-2 at Glasgow Haskell Compiler / GHC Commits: 5affd08b by Rodrigo Mesquita at 2026-05-08T14:49:38+01:00 docs: toException shouldn't insist on empty context ExceptionWithContext is an example of a type whose instance won't fulfill that contract (it would be non-sensical to empty the context of ExceptionWithContext...!) - - - - - bdb42453 by Rodrigo Mesquita at 2026-05-08T14:49:38+01:00 Draft: DONT TOUCH the toException in Exception SomeException! - - - - - 1 changed file: - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs Changes: ===================================== libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs ===================================== @@ -208,12 +208,10 @@ Caught MismatchedParentheses -} class (Typeable e, Show e) => Exception e where - -- | @toException@ should produce a 'SomeException' with no attached 'ExceptionContext'. toException :: e -> SomeException fromException :: SomeException -> Maybe e - toException e = SomeException e - where ?exceptionContext = emptyExceptionContext + toException e = e fromException (SomeException e) = cast e -- | Render this exception value in a human-friendly manner. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bd23cdd802e9f6e58568dc67dccb2ab... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bd23cdd802e9f6e58568dc67dccb2ab... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Rodrigo Mesquita (@alt-romes)