wsproxy: code removal and stylistic changes#7099
Open
contificate wants to merge 4 commits into
Open
Conversation
246b68d to
b6afc1d
Compare
psafont
reviewed
May 27, 2026
Signed-off-by: Colin James <colin.barr@vates.tech>
Signed-off-by: Colin James <colin.barr@vates.tech>
Signed-off-by: Colin James <colin.barr@vates.tech>
- Removes the enumeratee type abbreviation, as it's less terse than
spelling out the iteratee transformer function type ('a t -> 'a t t).
- Removes unused combinators from iteratees, such as "apply". The use
case for this is largely subsumed by writing effectful enumeratees,
such as the extant "stream_printer" adapter.
- Removes "extract_result_from_iteratee". This is unused but, in
general, it should have been partial, casing on the iteratee after
sending EOF to it (as the equivalent "run" function does in the
original iteratee resources).
Signed-off-by: Colin James <colin.barr@vates.tech>
b6afc1d to
1d74774
Compare
psafont
approved these changes
May 27, 2026
minglumlu
reviewed
May 28, 2026
| k stream | ||
| | x -> | ||
| IO.return (x, stream) | ||
| return (x, stream) |
Member
There was a problem hiding this comment.
I need to keep this in mind: in the continuation k, the return is always IO.return; while in f, it is Iteratee.return.
minglumlu
reviewed
May 28, 2026
| IE_cont (None, step n k) | ||
| | IE_cont (Some _, _) | IE_done _ -> | ||
| bind (drop n) (fun () -> return s) | ||
| function |
Member
There was a problem hiding this comment.
This is neater. But to be honest, fun s -> makes me think more quickly this is a continuation. 😄
minglumlu
approved these changes
May 28, 2026
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.
Removes some unused combinators from wsproxy and adds some stylistic changes (mostly preferring let-operators over infix monadic bind
>>=). These are just some changes I made when learning the iteratee style used in wslib/wsproxy.In future, we may rewrite wsproxy so as to remove the iteratee style (as it's not convenient for other websocket use cases, like a websocket server in full generality).