Conversation
9c03784 to
1fb1b82
Compare
1e40303 to
05d3567
Compare
8064578 to
a4e3b29
Compare
5 tasks
a4e3b29 to
915c73e
Compare
Also remove use of polysemy-mock from ExternalServer tests.
Co-authored-by: Sven Tennie <sven.tennie@gmail.com>
This implements the bracketing pattern needed for closing a streaming response at the level of the base monad, instead of introducing CPS for the main polysemy actions.
915c73e to
8a036b6
Compare
Also use the same return type for the response as the one in Servant.Client, namely `ResponseF`.
a81c958 to
7f193e9
Compare
mdimjasevic
reviewed
Dec 13, 2021
mdimjasevic
approved these changes
Dec 14, 2021
| deriving (Eq, Show) | ||
|
|
||
| mockService :: | ||
| Members [Output Call, Embed IO] r => |
Contributor
There was a problem hiding this comment.
How come this works by using a value-level list? I was expecting a type-level list here.
Contributor
Author
There was a problem hiding this comment.
It's not a value level list. The promotion tick is optional when the type is unambiguous. For the case of lists, this means that [A, B] is interpreted as something of kind [*] (i.e. the same as '[A, B], aka A ': B ': '[]), but [A] is interpreted as something of type * (i.e. the type of lists of A).
We can turn on -Wunticked-promoted-constructors to turn this into an error, if desired. Should we?
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is about allowing federator and federator client to stream responses to their clients. Instead of using explicit CPS everywhere, this is achieved by replacing
IOwithCodensity IOin the interpreters for theServiceandRemoteeffects. The streaming response type isStreamingResponsefromServant, even when using the low-level HTTP2 client API (withHTTP2Request).The underlying
SourceTtype is slightly more complicated than necessary for our purposes (e.g. we do not need itsErrorandSkipconstructors), but it is convenient not to have to define our own streaming abstraction.Tracked by https://wearezeta.atlassian.net/browse/FS-322.
Checklist
changelog.d.