Repository navigation
Replace implicits imports with syntax - #4917
Conversation
|
|
||
| # Common issues | ||
|
|
||
| The Cats type class instances for standard library types are available in implicit scope and hence no longer have to be imported. If anything doesn't compile as expected, first make sure all the required Cats syntax implicits are in the scope — try importing ```cats.syntax.all._``` and see if the problem persists. The only exception is here is Cat's own ```Order``` and ```PartialOrder``` type classes which are available by importing ```cats.implicits._```. |
There was a problem hiding this comment.
I removed this sentence about Order and PartialOrder, as my understanding is the normal way to import these would be to just import cats.Order / cats.PartialOrder these days.
a43c1e0 to
8c6bd98
Compare
8c6bd98 to
a805125
Compare
|
I don't see any reason why this change should cause the native build to fail, but I don't have a system to reproduce :/ |
Tests in ScalaNative are flaky – it's a known yet very annoying issue. |
|
@reardonj , I presume the goal of this PR is a complete sweep of the imports from the Detailscats/core/src/main/scala/cats/FlatMap.scala Line 161 in a805125 cats/core/src/main/scala/cats/data/IorT.scala Line 320 in a805125 The list can still be incomplete. Could you double check please? Thank you! |
ca1133c to
ab88dd6
Compare
That is my goal! I didn't think to search for relative imports. I've just searched for 'implicit' now and do not find any other uses as imports besides the ones you located. I've updated those, and also updated the relative |
There are a lot of random code snippets and documentation that still suggests importing
cats.implicits._instead ofcats.syntax.all._. This PR updates all of those. This was done as a straightforward search and replace.I did skip changing the scalafix rules and old changelog entries to preserve historical accuracy, so there are still some usages, but there should be nothing left to point users at the old ways.