Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "2.7.5"
version = "3.0.0"
align.preset = none
maxColumn = 120
includeNoParensInSelectChains = false
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/scala-2.12/cats/derived/semiauto.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats.derived

/** allows semi automatically derive each instance. The derivation might need help when
* there are fields with a type constructor that comes with instances, e.g.
/** allows semi automatically derive each instance. The derivation might need help when there are fields with a type
* constructor that comes with instances, e.g.
* {{{
* scala> case class Bar(a: String)
* scala> case class Foo(bars: List[Bar])
Expand All @@ -25,9 +25,9 @@ package cats.derived
* scala> implicit val fooShow: Show[Foo] = { |
* import cats.derived.auto.show._ |
* cats.derived.semiauto.show |
* }
* scala> Foo(List(Bar("a"))).show
* res3: String = Foo(bars = List(Bar(a = a)))
* }
* scala> Foo(List(Bar("a"))).show
* res3: String = Foo(bars = List(Bar(a = a)))
* }}}
*/
object semiauto extends SemiAutoInstances
10 changes: 5 additions & 5 deletions core/src/main/scala-2.13/cats/derived/semiauto.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package derived
import alleycats.{ConsK, Empty, EmptyK, Pure}
import cats.kernel.{CommutativeMonoid, CommutativeSemigroup}

/** allows semi automatically derive each instance. The derivation might need help when
* there are fields with a type constructor that comes with instances, e.g.
/** allows semi automatically derive each instance. The derivation might need help when there are fields with a type
* constructor that comes with instances, e.g.
* {{{
* scala> case class Bar(a: String)
* scala> case class Foo(bars: List[Bar])
Expand All @@ -29,9 +29,9 @@ import cats.kernel.{CommutativeMonoid, CommutativeSemigroup}
* scala> implicit val fooShow: Show[Foo] = { |
* import cats.derived.auto.show._ |
* cats.derived.semiauto.show |
* }
* scala> Foo(List(Bar("a"))).show
* res3: String = Foo(bars = List(Bar(a = a)))
* }
* scala> Foo(List(Bar("a"))).show
* res3: String = Foo(bars = List(Bar(a = a)))
* }}}
*/
object semiauto {
Expand Down
19 changes: 9 additions & 10 deletions core/src/main/scala/cats/derived/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import cats.derived.util.VersionSpecific.Lazy
import cats.kernel.{CommutativeMonoid, CommutativeSemigroup}
import shapeless.{Cached, Refute}

/** Fully automatically derive the instance, note that this derivation is not cached, so it
* will re-derive every time an instance is needed in the application, which could
* significantly impact the compilation time.
/** Fully automatically derive the instance, note that this derivation is not cached, so it will re-derive every time an
* instance is needed in the application, which could significantly impact the compilation time.
*/
object auto {

Expand Down Expand Up @@ -277,8 +276,8 @@ object auto {
}
}

/** cached cache the derived instance but this cache are global, so be cautious only use it
* when there is only one instance globally in your application.
/** cached cache the derived instance but this cache are global, so be cautious only use it when there is only one
* instance globally in your application.
*/
object cached {

Expand Down Expand Up @@ -495,8 +494,8 @@ abstract private[derived] class SemiAutoInstances {
def iterable[F[_], A](fa: F[A])(implicit F: MkIterable[F]): Iterable[A] = F.iterable(fa)
}

/** allows semi automatically derive each instance. The derivation might need help when
* there are fields with a type constructor that comes with instances, e.g.
/** allows semi automatically derive each instance. The derivation might need help when there are fields with a type
* constructor that comes with instances, e.g.
* {{{
* scala> case class Bar(a: String)
* scala> case class Foo(bars: List[Bar])
Expand All @@ -520,9 +519,9 @@ abstract private[derived] class SemiAutoInstances {
* scala> implicit val fooShow: Show[Foo] = { |
* import cats.derived.auto.show._ |
* cats.derived.semi.show |
* }
* scala> Foo(List(Bar("a"))).show
* res3: String = Foo(bars = List(Bar(a = a)))
* }
* scala> Foo(List(Bar("a"))).show
* res3: String = Foo(bars = List(Bar(a = a)))
* }}}
*/
@deprecated(message = "Use semiauto instead.", since = "2.1.0")
Expand Down
12 changes: 4 additions & 8 deletions core/src/main/scala/cats/derived/show.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ import util.VersionSpecific.{Lazy, OrElse}
import scala.annotation.implicitNotFound
import scala.reflect.ClassTag

/** Due to a limitation in the way Shapeless' `describe` is currently
* implemented, `Show` can't be derived for ADTs which are _both_
* recursive _and_ generic in one or more type parameters.
/** Due to a limitation in the way Shapeless' `describe` is currently implemented, `Show` can't be derived for ADTs
* which are _both_ recursive _and_ generic in one or more type parameters.
*
* See:
* https://github.com/typelevel/kittens/pull/48#issue-249836267
* https://github.com/milessabin/shapeless/issues/750
* See: https://github.com/typelevel/kittens/pull/48#issue-249836267 https://github.com/milessabin/shapeless/issues/750
*
* See the test suite for more precise examples of what can and cannot
* be derived.
* See the test suite for more precise examples of what can and cannot be derived.
*/
@implicitNotFound("""Could not derive an instance of Show[A] where A = ${A}.
Make sure that A satisfies one of the following conditions:
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/derived/util/liftSome.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package cats.derived.util

import shapeless._

/** Summons all available instances of the typeclass `F` for members of the coproduct `C`.
* Unlike `LiftAll` members of the coproduct without an instance will be skipped in the result.
/** Summons all available instances of the typeclass `F` for members of the coproduct `C`. Unlike `LiftAll` members of
* the coproduct without an instance will be skipped in the result.
*/
sealed trait LiftSome[F[_], C <: Coproduct] extends Serializable {
type Out <: HList
Expand Down
6 changes: 2 additions & 4 deletions core/src/test/scala/cats/derived/KittensSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ import cats.syntax.AllSyntax
import munit.DisciplineSuite
import org.scalacheck.Test.Parameters

/** An opinionated stack of traits to improve consistency and reduce
* boilerplate in Kittens tests. Note that unlike the corresponding
* CatsSuite in the Cat project, this trait does not mix in any
* instances.
/** An opinionated stack of traits to improve consistency and reduce boilerplate in Kittens tests. Note that unlike the
* corresponding CatsSuite in the Cat project, this trait does not mix in any instances.
*/
abstract class KittensSuite extends DisciplineSuite with AllSyntax {
override val scalaCheckTestParameters: Parameters = super.scalaCheckTestParameters
Expand Down