package derived
- Alphabetic
- Public
- Protected
Type Members
- sealed trait IterState[+A] extends AnyRef
- trait MkApplicative[F[_]] extends Applicative[F]
- Annotations
- @implicitNotFound()
- trait MkApply[F[_]] extends Apply[F]
- Annotations
- @implicitNotFound()
- trait MkCommutativeMonoid[A] extends CommutativeMonoid[A]
- Annotations
- @implicitNotFound()
- trait MkCommutativeSemigroup[A] extends CommutativeSemigroup[A]
- Annotations
- @implicitNotFound()
- trait MkConsK[F[_], G[_]] extends Serializable
- Annotations
- @implicitNotFound()
- trait MkContravariant[F[_]] extends Contravariant[F]
- Annotations
- @implicitNotFound()
- trait MkEmpty[A] extends Empty[A]
- Annotations
- @implicitNotFound()
- trait MkEmptyK[F[_]] extends EmptyK[F]
- Annotations
- @implicitNotFound()
- trait MkEq[A] extends Eq[A]
- Annotations
- @implicitNotFound()
- trait MkFoldable[F[_]] extends Foldable[F]
- Annotations
- @implicitNotFound()
- trait MkFunctor[F[_]] extends Functor[F]
- Annotations
- @implicitNotFound()
- trait MkHash[A] extends Hash[A]
- Annotations
- @implicitNotFound()
- trait MkInvariant[F[_]] extends Invariant[F]
- Annotations
- @implicitNotFound()
- trait MkIterable[F[_]] extends AnyRef
- Annotations
- @implicitNotFound()
- trait MkMonoid[A] extends Monoid[A]
- Annotations
- @implicitNotFound()
- trait MkMonoidK[F[_]] extends MonoidK[F]
- Annotations
- @implicitNotFound()
- trait MkNonEmptyTraverse[F[_]] extends NonEmptyTraverse[F] with MkTraverse[F] with MkReducible[F]
- Annotations
- @implicitNotFound()
- trait MkOrder[A] extends Order[A]
- Annotations
- @implicitNotFound()
- trait MkPartialOrder[A] extends PartialOrder[A]
- Annotations
- @implicitNotFound()
- trait MkPure[F[_]] extends Pure[F]
- Annotations
- @implicitNotFound()
- trait MkReducible[F[_]] extends Reducible[F] with MkFoldable[F]
- Annotations
- @implicitNotFound()
- trait MkSemigroup[A] extends Semigroup[A]
- Annotations
- @implicitNotFound()
- trait MkSemigroupK[F[_]] extends SemigroupK[F]
- Annotations
- @implicitNotFound()
- 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.
- Annotations
- @implicitNotFound()
- trait MkShowPretty[A] extends ShowPretty[A]
- Annotations
- @implicitNotFound()
- trait MkTraverse[F[_]] extends Traverse[F] with MkFoldable[F]
- Annotations
- @implicitNotFound()
- trait ShowPretty[A] extends Show[A]
- sealed abstract class Trivial1[F[_]] extends AnyRef
Value Members
- object IterState
- object MkApplicative extends MkApplicativeDerivation with Serializable
- object MkApply extends MkApplyDerivation with Serializable
- object MkCommutativeMonoid extends MkCommutativeMonoidDerivation with Serializable
- object MkCommutativeSemigroup extends MkCommutativeSemigroupDerivation with Serializable
- object MkConsK extends MkConsKDerivation with Serializable
- object MkContravariant extends MkContravariantDerivation with Serializable
- object MkEmpty extends MkEmptyDerivation with Serializable
- object MkEmptyK extends MkEmptyKDerivation with Serializable
- object MkEq extends MkEqDerivation with Serializable
- object MkFoldable extends MkFoldableDerivation with Serializable
- object MkFunctor extends MkFunctorDerivation with Serializable
- object MkHash extends MkHashDerivation with Serializable
- object MkInvariant extends MkInvariantDerivation with Serializable
- object MkIterable extends MkIterableDerivation
- object MkMonoid extends MkMonoidDerivation with Serializable
- object MkMonoidK extends MkMonoidKDerivation with Serializable
- object MkNonEmptyTraverse extends MkNonEmptyTraverseDerivation with Serializable
- object MkOrder extends MkOrderDerivation with Serializable
- object MkPartialOrder extends MkPartialOrderDerivation with Serializable
- object MkPure extends MkPureDerivation with Serializable
- object MkReducible extends MkReducibleDerivation with Serializable
- object MkSemigroup extends MkSemigroupDerivation with Serializable
- object MkSemigroupK extends MkSemigroupKDerivation with Serializable
- object MkShow extends MkShowDerivation with Serializable
- object MkShowPretty extends MkShowPrettyDerivation with Serializable
- object MkTraverse extends MkTraverseDerivation with Serializable
- object ShowPretty extends Serializable
- object Trivial1
- 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.
- 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.
- object function extends FunctionInstances
- object semiauto
allows semi automatically derive each instance.
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]) scala> import cats.instances.all._ scala> cats.derived.semiauto.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]
instanceYou could either derive a Bar instance first
scala> implicit val barShow = cats.derived.semi.show[Bar] scala> cats.derived.semiauto.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.semiauto.show | } scala> Foo(List(Bar("a"))).show res3: String = Foo(bars = List(Bar(a = a)))