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

Permit zero content types for empty response #51

Closed
jekor opened this issue Jan 10, 2018 · 3 comments
Closed

Permit zero content types for empty response #51

jekor opened this issue Jan 10, 2018 · 3 comments

Comments

@jekor
Copy link

jekor commented Jan 10, 2018

See haskell-servant/servant#69

Error:

    • Couldn't match type ‘'[]’ with ‘ct0 : cts0’
        arising from a use of ‘client’

Relevant code:

Delete '[] ()
@imalsogreg
Copy link
Owner

Thanks! I will try to get to this tonight EST

@imalsogreg
Copy link
Owner

@jekor Looking at newer servant-client code, I don't see special handling of () anymore - I believe this has been replaced by NoContent, and handlers over NoContent-returning endpoints permit zero content types. Does using NoContent work for you? If not, do you mind trying out kjd issue-51 branch? If it works we can think about merging it to master here, and discuss if servant-client should special-case () too as I think it used to.

https://github.com/haskell-servant/servant/blob/master/servant-client-core/src/Servant/Client/Core/Internal/HasClient.hs#L185-L241

@jekor
Copy link
Author

jekor commented Jan 12, 2018

Thanks. I've confirmed that the issue-51 branch compiles for me, but then I found out that '[] () will no longer compile with servant-server. I hadn't realized this, as the client gets compiled before the server in my build system.

NoContent works for me. Sorry for the distraction!

@jekor jekor closed this as completed Jan 12, 2018
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