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

ResponseGenerator: DRY up and relax method implementations #2614

Merged
merged 1 commit into from Jun 6, 2019

Conversation

@diesalbla
Copy link
Contributor

commented Jun 1, 2019

  • DRY out a method addEntityLenght, which transforms a set of headers by addding the Content-Length of an entity, if the length of that entity is known.
  • Relax type-class constraint of several methods from Monad to Applicative.

@diesalbla diesalbla force-pushed the diesalbla:ResponseGenerator_factor_methods branch from 3005932 to ac60ef1 Jun 1, 2019

ResponseGenerator: DRY up and relax method implementations
- We extract a method `addEntityLenght`, which transforms a set of
  headers by addding the `Content-Length` of an entity, if the length
  of that entity is known.
- We relax the type-class constraint of several methods, from Monad to Applicative.

@diesalbla diesalbla force-pushed the diesalbla:ResponseGenerator_factor_methods branch from ac60ef1 to 4484111 Jun 1, 2019

@rossabaker
Copy link
Member

left a comment

I think the Monad used to be necessary and ceased to be when EntityEncoder became pure, and we never caught it. This looks good to me.

@aeons aeons merged commit b3ea4b2 into http4s:master Jun 6, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@diesalbla diesalbla deleted the diesalbla:ResponseGenerator_factor_methods branch Jun 6, 2019

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