Package

cats

derived

Permalink

package derived

Visibility
  1. Public
  2. All

Type Members

  1. sealed trait IterState[+A] extends AnyRef

    Permalink
  2. trait MkApplicative[F[_]] extends Applicative[F]

    Permalink
    Annotations
    @implicitNotFound( ... )
  3. trait MkApply[F[_]] extends Apply[F]

    Permalink
    Annotations
    @implicitNotFound( ... )
  4. trait MkConsK[F[_], G[_]] extends Serializable

    Permalink
    Annotations
    @implicitNotFound( ... )
  5. trait MkEmpty[A] extends Empty[A]

    Permalink
    Annotations
    @implicitNotFound( ... )
  6. trait MkEmptyK[F[_]] extends EmptyK[F]

    Permalink
    Annotations
    @implicitNotFound( ... )
  7. trait MkEq[A] extends Eq[A]

    Permalink
    Annotations
    @implicitNotFound( ... )
  8. trait MkFoldable[F[_]] extends Foldable[F]

    Permalink
    Annotations
    @implicitNotFound( ... )
  9. trait MkFunctor[F[_]] extends Functor[F]

    Permalink
    Annotations
    @implicitNotFound( ... )
  10. trait MkHash[A] extends Hash[A]

    Permalink
    Annotations
    @implicitNotFound( ... )
  11. trait MkIterable[F[_]] extends AnyRef

    Permalink
    Annotations
    @implicitNotFound( ... )
  12. trait MkMonoid[A] extends Monoid[A]

    Permalink
    Annotations
    @implicitNotFound( ... )
  13. trait MkMonoidK[F[_]] extends MonoidK[F]

    Permalink
    Annotations
    @implicitNotFound( ... )
  14. trait MkOrder[A] extends Order[A]

    Permalink
    Annotations
    @implicitNotFound( ... )
  15. trait MkPartialOrder[A] extends PartialOrder[A]

    Permalink
    Annotations
    @implicitNotFound( ... )
  16. trait MkPure[F[_]] extends Pure[F]

    Permalink
    Annotations
    @implicitNotFound( ... )
  17. trait MkSemigroup[A] extends Semigroup[A]

    Permalink
    Annotations
    @implicitNotFound( ... )
  18. trait MkSemigroupK[F[_]] extends SemigroupK[F]

    Permalink
    Annotations
    @implicitNotFound( ... )
  19. trait MkShow[A] extends Show[A]

    Permalink

    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.

    Annotations
    @implicitNotFound( ... )
  20. trait MkShowPretty[A] extends ShowPretty[A]

    Permalink
    Annotations
    @implicitNotFound( ... )
  21. trait MkTraverse[F[_]] extends Traverse[F]

    Permalink
    Annotations
    @implicitNotFound( ... )
  22. trait ShowPretty[A] extends Show[A]

    Permalink
  23. sealed abstract class Trivial1[F[_]] extends AnyRef

    Permalink

Value Members

  1. object IterState

    Permalink
  2. object MkApplicative extends MkApplicativeDerivation with Serializable

    Permalink
  3. object MkApply extends MkApplyDerivation with Serializable

    Permalink
  4. object MkConsK extends MkConsKDerivation with Serializable

    Permalink
  5. object MkEmpty extends MkEmptyDerivation with Serializable

    Permalink
  6. object MkEmptyK extends MkEmptyKDerivation with Serializable

    Permalink
  7. object MkEq extends MkEqDerivation with Serializable

    Permalink
  8. object MkFoldable extends MkFoldableDerivation with Serializable

    Permalink
  9. object MkFunctor extends MkFunctorDerivation with Serializable

    Permalink
  10. object MkHash extends MkHashDerivation with Serializable

    Permalink
  11. object MkIterable extends MkIterableDerivation

    Permalink
  12. object MkMonoid extends MkMonoidDerivation with Serializable

    Permalink
  13. object MkMonoidK extends MkMonoidKDerivation with Serializable

    Permalink
  14. object MkOrder extends MkOrderDerivation with Serializable

    Permalink
  15. object MkPartialOrder extends MkPartialOrderDerivation with Serializable

    Permalink
  16. object MkPure extends MkPureDerivation with Serializable

    Permalink
  17. object MkSemigroup extends MkSemigroupDerivation with Serializable

    Permalink
  18. object MkSemigroupK extends MkSemigroupKDerivation with Serializable

    Permalink
  19. object MkShow extends MkShowDerivation with Serializable

    Permalink
  20. object MkShowPretty extends MkShowPrettyDerivation with Serializable

    Permalink
  21. object MkTraverse extends MkTraverseDerivation with Serializable

    Permalink
  22. object ShowPretty extends Serializable

    Permalink
  23. object Trivial1

    Permalink
  24. object auto

    Permalink

    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.

  25. object cached

    Permalink

    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.

  26. object semi

    Permalink

    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)))
  27. package util

    Permalink

Ungrouped