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

PushSupport.collectResponse: simplify code. #2531

Merged
merged 1 commit into from Apr 28, 2019

Conversation

Projects
None yet
3 participants
@diesalbla
Copy link
Contributor

commented Apr 26, 2019

We try to simplify the code of PushSupport.collectResponse.

  • We extract the main function from the foldLeft into a separate local function.
  • Since we are not staying in the OptionT, we replace the special combinators semiFlatMap, mapF, or liftT, by the Monad methods of the base F, and pattern-matches on the Option constructors.

@diesalbla diesalbla force-pushed the diesalbla:push_simplify branch 2 times, most recently from dd58036 to f04bc21 Apr 26, 2019

PushSupport.collectResponse: simplify code.
We try to simplify the code of PushSupport.collectResponse.
- We extract the main function from the foldLeft into a separate
  local function.
- Since we are not staying in the `OptionT`, we replace the special
  combinators `semiFlatMap`, `mapF`, or `liftT`, by the Monad  methods
  of the base `F`, and pattern-matches on the Option constructors.

@diesalbla diesalbla force-pushed the diesalbla:push_simplify branch from f04bc21 to ea24346 Apr 27, 2019

@rossabaker
Copy link
Member

left a comment

This would benefit from being a chain instead of a vector, but that would be better as a separate PR, as it would break compatibility.

Build failures are unrelated.

@aeons aeons merged commit 0d47486 into http4s:master Apr 28, 2019

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details

@diesalbla diesalbla deleted the diesalbla:push_simplify branch May 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.