{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreibvmqey4ygwkny2qmzi5r53loul2rasxhflhq5plgu6h6axcryq7a",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mligfyzlg3h2"
},
"path": "/t/exception-annotations-lay-of-the-land/14056#post_3",
"publishedAt": "2026-05-10T08:45:26.000Z",
"site": "https://discourse.haskell.org",
"textContent": "At the risk of confusing myself and others (this is full of subtle issues!)\n\nSuppose we made the `toException` of _both_ `SomeException` and `ExceptionWithContext` actually respect the “produce a `SomeException` with no attached `ExceptionContext`” invariant. No exceptions (pun accidental) for it!\n\nSuppose as well that we add a separate `toExceptionPreservingContext :: ExceptionWithContext e -> SomeException` function, and also redefine `rethrowIO` as\n\n\n rethrowIO :: Exception e => ExceptionWithContext e -> IO a\n rethrowIO e = throwIO (NoBacktrace (toExceptionPreservingContext e))\n\n\nWould that work / bet better? Instance definitions would be more uniform, at least.",
"title": "Exception Annotations: Lay of the Land"
}