Http4s: Add clippy notes

Created on 18 Dec 2016  路  3Comments  路  Source: http4s/http4s

https://github.com/softwaremill/scala-clippy looks pretty neat, let's add a few.

[error] ReportService.scala:22: type mismatch;
[error]  found   : [A](body: A, headers: org.http4s.Headers)(implicit w: org.http4s.EntityEncoder[A])scalaz.concurrent.Task[org.http4s.Response] <and> [A](body: A)(implicit w: org.http4s.EntityEncoder[A])scalaz.concurrent.Task[org.http4s.Response] <and> ()scalaz.concurrent.Task[org.http4s.Response]
[error]  required: Report => scalaz.concurrent.Task[org.http4s.Response]
[error]         ReportGenerator.getBasicReport(params, xa).flatMap(Ok.apply)

Specifically the flatMap(Ok.apply) - you must do OK(_) for the implicit param list to get used correctly, because ok.apply is apply(a:A)(implicit EntityEncoder[A])

docs good first issue

Most helpful comment

Interesting. I hadn't seen scala-clippy. Another thing we can do that might be more useful (i.e., not require a build plugin on the user's part) is adding @implicitNotFound for our type classes.

All 3 comments

Interesting. I hadn't seen scala-clippy. Another thing we can do that might be more useful (i.e., not require a build plugin on the user's part) is adding @implicitNotFound for our type classes.

@rossabaker Got a few typeclasses in mind for that?

EntityEncoder and EntityDecoder are the two that jump immediately to mind.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

reactormonk picture reactormonk  路  5Comments

rossabaker picture rossabaker  路  9Comments

jfwilson picture jfwilson  路  4Comments

drocsid picture drocsid  路  5Comments

ChristopherDavenport picture ChristopherDavenport  路  4Comments