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

servant-client: Why defaultMakeClientRequest had to be changed to return IO? #1787

Open
unclechu opened this issue Sep 29, 2024 · 2 comments

Comments

@unclechu
Copy link
Contributor

One of my project stopped building, because of a breaking change, the result of defaultMakeClientRequest (which is just Network.HTTP.Client.Request) no longer showable. Because now it returns IO Request compared to previously returning just Request. I looked at the sources and see only:

return Client.defaultRequest ...

So there are actually no side-effects. What’s the point of having this return and wrapping the result into IO breaking the backward-compatibility? Are there any plans to have some side-effects in the future for this function? Maybe drop a comment about it if that’s true?

If this was some kind of a mistake and you don’t want to break API again, maybe at least change the type to Monad m => ... -> m Request so one can just use some Identity without a need to involve IO for no reason while previous code written for when it was IO would still work and be compatible?

@arianvp
Copy link
Member

arianvp commented Sep 30, 2024

@unclechu
Copy link
Contributor Author

@arianvp thanks for the link, though trying to read it through it still does not answer my question, changelog says “Run ClientEnv's makeClientRequest in IO.” okay, but why would you ever do that? So that you don’t need to write pure/return somewhere else? A pretty questionable idea to make it hardly depend on IO for that alone reason.

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

2 participants