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 bug=impureThrow #100

Closed
int-index opened this issue Dec 19, 2017 · 3 comments
Closed

Add bug=impureThrow #100

int-index opened this issue Dec 19, 2017 · 3 comments

Comments

@int-index
Copy link
Member

Define bug roughly as follows:

import Control.Exception.Safe (impureThrow)

data Bug = Bug SomeException CallStack

instance Exception Bug

bug :: (HasCallStack, Exception e) => e -> a
bug e = impureThrow $ Bug (toException e) ?callStack
@chshersh
Copy link
Contributor

@int-index Could you please explain why we need to store HasCallStack explicitly in Bug constructor?

@int-index
Copy link
Member Author

Because we want to use it in displayException for Bug.

@int-index
Copy link
Member Author

That is how it is done for ErrorCall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants