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

Make defaultMakeClientRequest not depend on IO #1789

Conversation

unclechu
Copy link
Contributor

@unclechu unclechu commented Oct 1, 2024

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
@tchoutri tchoutri merged commit 4cdbbbd into haskell-servant:master Oct 1, 2024
6 checks passed
@tchoutri
Copy link
Contributor

tchoutri commented Oct 1, 2024

@unclechu Thanks for the patch

theophile-scrive pushed a commit to theophile-scrive/servant that referenced this pull request Dec 8, 2024
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
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

Successfully merging this pull request may close these issues.

2 participants