-
-
Notifications
You must be signed in to change notification settings - Fork 413
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: Run ClientEnv's makeClientRequest in IO #1595
servant-client: Run ClientEnv's makeClientRequest in IO #1595
Conversation
@Minnozz Hi! Has there been a discussion about this PR? :) |
@tchoutri Hi! This change was suggested by |
Great, then I'll leave @alpmestan review your PR. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me. We'll want to add an entry in the relevant changelog. Also, this will force a major version bump.
Let's perhaps leave a few days to give others a chance to give feedback on this, and for you to add a changelog entry (see how other PRs do it, with entries in the changelog.d
directory).
@alpmestan I added a changelog entry, do you think it needs more explanation? |
@Minnozz Should be fine, I think people using servant are familiar enough with If you ever feel like writing down a little something that demonstrates how you're using this to your advantage (cookbook recipe, blog post, whatever), then it can serve as a reference for users who might need this in the future. But that's more work that adding a few lines in the changelog :-) |
Considering the approval of this PR, I will merge, but a cookbook or a blog post would be very appreciated, @Minnozz :) |
Please have a look at #1787 trying to read this change through I can’t say why this change is necessary. Why was it worth to break the API? Why does it have to be exactly |
@unclechu The change was necessary for my project to be able to call applyDigestAuth, as is noted in the description of this PR. As for requiring precisely IO: as a Haskell novice I did not understand the difference between IO and MonadIO when I made this PR; feel free to propose a PR with a better API :) |
+1, submit a PR to depend on MonadIO, it would be an improvement. |
I don’t think it was necessary, you could always call
I’ll make a pull request. |
It's not about |
I would just mean the only change required is for |
The `IO` wrap for the return type of this function was never necessary. Inside the function there’s only `return` call that wraps a _pure_ value into `IO`. There is nothing else that would be related to `IO`. The `IO` wrap was introduced in 9df16f9 In order to not break the API again the wrap was preserved but this change makes it to depend on any `Applicative` instead of `IO`. So it still works in `IO`/`MonadIO` context but allows to use something like `Data.Functor.Identity` to work with _pure_ values. See for more context: haskell-servant#1595
The change for the |
The `IO` wrap for the return type of this function was never necessary. Inside the function there’s only `return` call that wraps a _pure_ value into `IO`. There is nothing else that would be related to `IO`. The `IO` wrap was introduced in 9df16f9 In order to not break the API again the wrap was preserved but this change makes it to depend on any `Applicative` instead of `IO`. So it still works in `IO`/`MonadIO` context but allows to use something like `Data.Functor.Identity` to work with _pure_ values. See for more context: #1595
The `IO` wrap for the return type of this function was never necessary. Inside the function there’s only `return` call that wraps a _pure_ value into `IO`. There is nothing else that would be related to `IO`. The `IO` wrap was introduced in 9df16f9 In order to not break the API again the wrap was preserved but this change makes it to depend on any `Applicative` instead of `IO`. So it still works in `IO`/`MonadIO` context but allows to use something like `Data.Functor.Identity` to work with _pure_ values. See for more context: haskell-servant#1595
Use cases: