-
Notifications
You must be signed in to change notification settings - Fork 16
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
Remove Rpc monad #17
Comments
I'd like to see examples of where you see that, because in the code we have at work
The fact that all your exceptions aren't being caught isn't a good argument for doing away with For an example of some of our code calling
That would be reasonable if there is only one or two layers of software. I've been spending time chasing exceptions in some of our code. Our code is called mismi, which sits on top of amazonka, which sits on top of http-conduit which sits on top of http-client-tls which sits on top of tls which sits on top of network. The problem I've been chasing is that (very) occasionally we have been getting an exception that bubbles up to the top and kills a complex multi-threaded program. |
Discussion started here; https://plus.google.com/+ErikdeCastroLopo/posts/TbRiXuNucED |
@erikd The ExceptT library I've used doesn't have all your fancy combinators. It looks much more composable with a proper library, indeed.
|
I guess I need to define an alternative liftIO that will catch IO exceptions and put them into RpcError. |
What about |
Yes, though maybe it'd be nice to provide some utility that converts into RpcError. Thanks, @erikd, looks like I can continue to use ExceptT :) |
I'm writing a blog post about this stuff. Will let you and Sean read it before I post it publically. |
@erikd Great, please show some common idioms, that'd be useful. In the case of gRPC, |
If you can wait another couple of hours, the code for my blog post will probably be ready :). Its spring where you are right? If the weather is good, you should go an enjoy it :). |
First pass at the code for my blog post is at https://github.com/erikd/exceptT-demo You would mainly be interested in this file. |
The Rpc monad is defined as
which is problematic.
It doesn't compose well. Catching errors in the monad gives a false security that exceptions have been caught, since there are also IO exceptions and pure exceptions.
Currently no other feature are needed from the monad except for exceptions (no pun intended).
I'd like to remove the Rpc monad and just throw IO exceptions, and document properly what method will throw, and on best practices.
The text was updated successfully, but these errors were encountered: