p

cats

derived

package derived

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait IterState[+A] extends AnyRef
  2. trait IterableDerivationFromMkIterable extends AnyRef
  3. trait MkConsK[F[_], G[_]] extends AnyRef
  4. trait MkConsK0 extends MkConsK1
  5. trait MkConsK1 extends MkConsK2
  6. trait MkConsK2 extends AnyRef
  7. trait MkEmpty[A] extends Empty[A]
    Annotations
    @implicitNotFound("Could not derive an instance of Empty[${A}]")
  8. trait MkEmptyK[F[_]] extends EmptyK[F]
  9. trait MkEmptyK0 extends MkEmptyK1
  10. trait MkEmptyK1 extends MkEmptyK2
  11. trait MkEmptyK2 extends MkEmptyK3
  12. trait MkEmptyK3 extends AnyRef
  13. trait MkEmptyKDerivation extends MkEmptyK0
  14. trait MkEq[T] extends Eq[T]
  15. trait MkFoldable[F[_]] extends Foldable[F]
  16. trait MkFoldable0 extends MkFoldable1
  17. trait MkFoldable1 extends MkFoldable2
  18. trait MkFoldable2 extends MkFoldable3
  19. trait MkFoldable3 extends AnyRef
  20. trait MkFoldableDerivation extends MkFoldable0
  21. trait MkFunctor[F[_]] extends Functor[F]
    Annotations
    @implicitNotFound("Could not derive an instance of Functor[${F}]")
  22. trait MkHash[A] extends Hash[A]
  23. trait MkHash0 extends MkHash1
  24. trait MkHash1 extends AnyRef
  25. trait MkIterable[F[_]] extends AnyRef
  26. trait MkIterable0 extends MkIterable1
  27. trait MkIterable1 extends MkIterable2
  28. trait MkIterable2 extends MkIterable3
  29. trait MkIterable3 extends AnyRef
  30. trait MkMonoid[T] extends Monoid[T]
  31. trait MkMonoidK[F[_]] extends MonoidK[F]
  32. trait MkOrder[T] extends Order[T]
  33. trait MkPartialOrder[T] extends PartialOrder[T]
  34. trait MkPure[F[_]] extends Pure[F]
  35. trait MkPure0 extends MkPure1
  36. trait MkPure1 extends MkPure2
  37. trait MkPure2 extends AnyRef
  38. trait MkPureDerivation extends MkPure0
  39. trait MkSemigroup[T] extends Semigroup[T]
  40. trait MkSemigroupK[F[_]] extends SemigroupK[F]
  41. trait MkSemigroupK4 extends AnyRef
  42. trait MkShow[A] extends Show[A]

    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 the test suite for more precise examples of what can and cannot be derived.

  43. trait MkShow1 extends MkShow2
  44. trait MkShow2 extends MkShow3
  45. trait MkShow3 extends AnyRef
  46. trait MkShowDerivation extends MkShow1
  47. trait MkShowPretty[A] extends ShowPretty[A]
  48. trait MkShowPretty1 extends MkShowPretty2
  49. trait MkShowPretty2 extends MkShowPretty3
  50. trait MkShowPretty3 extends AnyRef
  51. trait MkShowPrettyDerivation extends MkShowPretty1
  52. trait ShowPretty[A] extends Show[A]
  53. trait Trivial1[F[_]] extends AnyRef

Value Members

  1. object HashBuilder
  2. object IterState
  3. object MkConsK extends MkConsK0
  4. object MkEmpty extends MkEmptyDerivation with Serializable
  5. object MkEmptyK extends MkEmptyKDerivation with Serializable
  6. object MkEq extends MkEqDerivation with Serializable
  7. object MkFoldable extends MkFoldableDerivation with Serializable
  8. object MkFunctor extends MkFunctorDerivation with Serializable
  9. object MkHash extends MkHash0 with Serializable
  10. object MkIterable extends MkIterable0
  11. object MkMonoid extends MkMonoidDerivation with Serializable
  12. object MkMonoidK extends MkMonoidK0 with Serializable
  13. object MkOrder extends MkOrderDerivation with Serializable
  14. object MkPartialOrder extends MkPartialOrderDerivation with Serializable
  15. object MkPure extends MkPureDerivation with Serializable
  16. object MkSemigroup extends MkSemigroupDerivation with Serializable
  17. object MkSemigroupK extends MkSemigroupK0 with Serializable
  18. object MkShow extends MkShowDerivation with Serializable
  19. object MkShowPretty extends MkShowPrettyDerivation with Serializable
  20. object ShowPretty extends Serializable
  21. object Trivial1
  22. object auto

    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.

  23. object cached

    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.

  24. object consk
  25. object semi

    allows semi automatically derive each instance.

    allows semi automatically derive each instance. The derivation might need help when there are fields with type constructor that comes with instances e.g.

    scala> case class Foo(bars: List[Bar])
    scala> case class Bar(a: String)
    
    scala> cats.derived.semi.show[Foo].show(Foo(List(Bar("a"))))
    res1: String = Foo(bars = $colon$colon(head = Bar(a = a), tl$access$1 = Nil.type()))

    Note that semi.show didn't respect the native Show[List] instance

    You could either derive a Bar instance first

    scala> implicit val barShow = cats.derived.semi.show[Bar]
    
    scala> cats.derived.semi.show[Foo].show(Foo(List(Bar("a"))))
    res2: String = Foo(bars = List(Bar(a = a)))

    Or you can take advantage of a controlled auto derivation

     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)))

Ungrouped