Skip to content

Conversation

diesalbla
Copy link
Contributor

The use of >> and guard from Alternative type-class can be replaced with basic if-then-else Scala construct.

@mergify mergify bot added series/0.23 PRs targeting 0.23.x module:ember-client labels May 29, 2022
@diesalbla diesalbla changed the title Ember-Client: rewrite without "Alternative" Ember-Client: no Alternative May 29, 2022
},
)
)
optH2 <- (if (enableHttp2) tlsContextOptWithDefault else None).traverse { context =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it the case when Applicative#when fits well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because this yields an Option, and the when is for F[Unit]. In any case, that is still less straightforward than if-then-else.

The use of Alternative type-class can be replaced with basic Scala construct.
@armanbilge armanbilge merged commit 20efcfa into http4s:series/0.23 Jun 5, 2022
@rossabaker rossabaker added the behind-the-scenes Appreciated, but not user-facing label Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behind-the-scenes Appreciated, but not user-facing module:ember-client series/0.23 PRs targeting 0.23.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants