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

Use explicit forall on most functions to allow exception type to be pinned more easily #32

Open
3noch opened this issue Aug 22, 2018 · 4 comments

Comments

@3noch
Copy link

3noch commented Aug 22, 2018

With -XTypeApplications you can do this with base's try: try @HttpException $ do... which is pretty handy. But with safe-exceptions you must do try @IO @HttpException. If the type parameters were explicitly ordered the other way around, the @IO could be "curried", i.e. left for type inference, more easily.

@bitemyapp
Copy link

Just wondering, does try @_ @HttpException work for you?

@3noch
Copy link
Author

3noch commented Aug 22, 2018

@bitemyapp I should have mentioned that. I thought it required -XPartialTypeSignatures but I see that it does not. That certainly helps. Ideally, though, I think one would be able to simply change the import Control.Exception (...) import to import Control.Exception.Safe (...) and not have to change anything else.

@3noch
Copy link
Author

3noch commented Aug 23, 2018

@bitemyapp Thanks for bringing that up.

@snoyberg
Copy link
Member

I'm pretty terrified at how easily we can introduce breaking changes into the public API of a package thanks to TypeApplications. I'm not too terribly excited about supporting this workflow as a result, but I'll accept a PR with the change.

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

No branches or pull requests

3 participants