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

Reinstate examples #2139

Merged
merged 4 commits into from Oct 2, 2018
Merged

Reinstate examples #2139

merged 4 commits into from Oct 2, 2018

Conversation

@aeons
Copy link
Member

@aeons aeons commented Sep 30, 2018

Fixes #2107

Updated and re-enabled all the example projects.
There's less inheritance now, and everything should use F[_] all the way up to IOApp.

The examples are not 100% consistent with each other.

I updated the push support syntax to operate on Response[F] instead of F[Response[F]], to be in line with the syntax on response and request. I did not add a deprecated copy of the old behaviour. I can add that if you guys want it.

@aeons aeons force-pushed the reinstate-examples branch from faeb1bd to 591058f Oct 1, 2018
Copy link
Member

@rossabaker rossabaker left a comment

This is nice. I think there's still room for improvement, but it's most important to get these back in business.

@@ -37,6 +38,6 @@ object ClientMultipartPostExample extends IOApp with Http4sClientDsl[IO] {
def run(args: List[String]): IO[ExitCode] =
BlazeClientBuilder[IO](global).resource
.use(go)
.flatMap(s => IO(println))
.flatMap(s => IO(println(s)))
Copy link
Member

@rossabaker rossabaker Oct 2, 2018

😳

@@ -19,7 +19,7 @@ class GitHubService[F[_]: Sync](client: Client[F]) extends Http4sClientDsl[F] {

private val RedirectUri = s"http://localhost:8080/$ApiVersion/login/github"

final case class AccessTokenResponse(access_token: String)
case class AccessTokenResponse(access_token: String)
Copy link
Member

@rossabaker rossabaker Oct 2, 2018

I like the final on case classes. It doesn't matter much here, but it's a good habit.

Copy link
Member Author

@aeons aeons Oct 2, 2018

Yeah, me too, but this one doesn't compile if it's final :)


logger.trace(s"Adding push resource: $newUrl")
final class PushOps[F[_]: Functor](response: Response[F]) extends AnyRef {
Copy link
Member

@rossabaker rossabaker Oct 2, 2018

Yes, this change makes a lot more sense.

@rossabaker rossabaker merged commit 57c08bf into http4s:master Oct 2, 2018
2 checks passed
@aeons aeons deleted the reinstate-examples branch Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants