-
Notifications
You must be signed in to change notification settings - Fork 0
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
Spooky code #2
Comments
Thanks for the review! I'll take a look at them ASAP -- the type aliases shouldn't be too much of a problem, so that tackles 90% of your comments. With regards to "what if it fails to parse", either a ProtocolError is thrown (if the message could be parsed but is not what we expected) or |
I don't have strong opinions here. My preference is to not "hide" input-related errors into an exception/fail/error, and reserve exceptions for exceptional cases but you might very well have a good reason for doing as you do so I'm not going to make a recommendation. Errors that can be caused by mere input invalidity I usually lift into a sum type and return in EitherT. Usually. Sounds like you're on the right track then. Good hacking :) 🐻 |
Well I explicitly decided to also use MonadMask / MonadCatch for that reason, to not 'hide' the exceptions. but I get where you're coming from: exceptions have an impure feeling to them, and it might be cleaner to use Either. Doing that would require a lot of refactoring, though, so at the moment I'm going to pass on that one. I decided to model the library in the same way as Haskell's IO is modeled, which also works with exceptions. I'll make a separate issue out of that one, though, so I won't forget. |
@solatis yeah I don't feel strongly about MonadMask/MonadCatch vs. EitherT in this case at all. I don't think the churn is worth it until you've kicked it around and have a feel for things. |
These are suggestions, act/ignore as thou wilt.
[Integer]
HTH.
The text was updated successfully, but these errors were encountered: