Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add annotateIO to io-classes #156

Closed
coot opened this issue May 12, 2024 · 0 comments · Fixed by #161
Closed

Add annotateIO to io-classes #156

coot opened this issue May 12, 2024 · 0 comments · Fixed by #161
Assignees
Labels
enhancement New feature or request

Comments

@coot
Copy link
Collaborator

coot commented May 12, 2024

annotateIO is added to base-4.20 published with ghc-9.10:

-- | Execute an 'IO' action, adding the given 'ExceptionContext'
-- to any thrown synchronous exceptions.
--
-- @since base-2.20.0.0
annotateIO :: forall e a. ExceptionAnnotation e => e -> IO a -> IO a
annotateIO ann (IO io) = IO (catch# io handler)
  where
    handler se = raiseIO# (addExceptionContext ann se)

This should be added to MonadThrow.

@coot coot added the enhancement New feature or request label May 12, 2024
@coot coot linked a pull request May 13, 2024 that will close this issue
@coot coot self-assigned this May 13, 2024
@coot coot linked a pull request May 17, 2024 that will close this issue
@coot coot closed this as completed in #161 May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant