-
-
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
Integrate MultiVerb into the servant
packages
#1766
base: master
Are you sure you want to change the base?
Integrate MultiVerb into the servant
packages
#1766
Conversation
b476b8f
to
84ccbd0
Compare
servant
packageservant
package
servant
packageservant
packages
ff04313
to
9e0d8d2
Compare
d10fc87
to
4ecb4ec
Compare
b7e31f0
to
77d471f
Compare
a61130b
to
046d35f
Compare
8be000f
to
1a6b30d
Compare
9e43f6e
to
9835857
Compare
6d3234e
to
3a84e18
Compare
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.
sorry for dropping the ball. here are some more comments. i'll continue with the review soon, i promise! :)
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.
Sorry for the lag, but I think we're getting there!
Could you go through the unresolved comments one more time and confirm that you're ok with resolving all of them?
If so I'll approve this PR.
After that: @arianvp wanna give it a read, and maybe merge? @pcapriotti as the author of this code, do you have any feedback?
57e5a38
to
e70eaec
Compare
e70eaec
to
c52bd5c
Compare
@pcapriotti @fisx I'd love your final feedback on this. :) |
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.
Nice feature, and very nice to read PR!
I made some comments, but none of them should be considered blocking!
servant-client-core/src/Servant/Client/Core/ResponseUnrender.hs
Outdated
Show resolved
Hide resolved
-- | ||
-- Similar to 'Respond', but hardcodes the content type to be used for | ||
-- generating the response. | ||
data RespondAs ct (s :: Nat) (description :: Symbol) (a :: Type) |
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.
It feels a bit sad that there are two locations where a content-type may be specified, and they can be conflicting. It's not obvious to me what:
type Responses = '[ RespondAs 'HTML 200 "blah" Int ]
type API = MultiVerb 'GET '[JSON] Responses Result
Means, and why I should be allowed to say this.
Is there any reason to have this besides RespondEmpty
? If not, maybe RespondEmpty
can be it's own datatype?
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.
Good call. @pcapriotti @fisx I'd like your input on this.
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.
sorry for taking so incredibly long! 😳
This commit is Part 1 of the integration, where only the `servant`Epackage is touched. `Verb` is redefined as an alias for `MultiVerb1` inEorder to make the transition transparent to users of `Verb`.
c52bd5c
to
86b0f6a
Compare
This commit is Part 1 of the integration, where only the packages of this monorepo are touched.
MultiVerb
is integrated alongside of the other Verb machinery, so that people may take their time to transition to it.IsWaiBody will not be able to live in its current form, as it mixes concepts from the Server and Client packages.
This impacts SomeResponse, which itself impacts the HasClient and HasServer instances.
ResponseF can be replicated internally, even without the httpVersion field.
SomeResponse can be kept on the server, but the client can move to use ResponseF.
The
IsResponse
andIsResponseList
classes are split between client-sideReponse{,List}Unrender
and server-sideResponse{,List}Render
.This is a collaborative work between Scrive AB and Wire Swiss GmbH.