Object

cats.derived

semi

Related Doc: package derived

Permalink

object semi

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)))
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. semi
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def applicative[F[_]](implicit F: Lazy[MkApplicative[F]]): Applicative[F]

    Permalink
  5. def apply[F[_]](implicit F: Lazy[MkApply[F]]): Apply[F]

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def consK[F[_]](implicit F: Lazy[MkConsK[F, F]]): ConsK[F]

    Permalink
  9. def empty[A](implicit ev: Lazy[MkEmpty[A]]): Empty[A]

    Permalink
  10. def emptyK[F[_]](implicit F: Lazy[MkEmptyK[F]]): EmptyK[F]

    Permalink
  11. def eq[A](implicit ev: Lazy[MkEq[A]]): Eq[A]

    Permalink
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def foldable[F[_]](implicit F: Lazy[MkFoldable[F]]): Foldable[F]

    Permalink
  16. def functor[F[_]](implicit F: Lazy[MkFunctor[F]]): Functor[F]

    Permalink
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hash[A](implicit ev: Lazy[MkHash[A]]): Hash[A]

    Permalink
  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. def iterable[F[_], A](fa: F[A])(implicit F: MkIterable[F]): Iterable[A]

    Permalink
  22. def monoid[A](implicit ev: Lazy[MkMonoid[A]]): Monoid[A]

    Permalink
  23. def monoidK[F[_]](implicit F: Lazy[MkMonoidK[F]]): MonoidK[F]

    Permalink
  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. def order[A](implicit ev: Lazy[MkOrder[A]]): Order[A]

    Permalink
  28. def partialOrder[A](implicit ev: Lazy[MkPartialOrder[A]]): PartialOrder[A]

    Permalink
  29. def pure[F[_]](implicit F: Lazy[MkPure[F]]): Pure[F]

    Permalink
  30. def semigroup[T](implicit ev: Lazy[MkSemigroup[T]]): Semigroup[T]

    Permalink
  31. def semigroupK[F[_]](implicit F: Lazy[MkSemigroupK[F]]): SemigroupK[F]

    Permalink
  32. def show[A](implicit ev: Lazy[MkShow[A]]): Show[A]

    Permalink
  33. def showPretty[A](implicit ev: Lazy[MkShowPretty[A]]): ShowPretty[A]

    Permalink
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  36. def traverse[F[_]](implicit F: Lazy[MkTraverse[F]]): Traverse[F]

    Permalink
  37. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped