diff --git a/docs/docs/docs/LibraryIntegrations.md b/docs/docs/docs/LibraryIntegrations.md index 0f28798..ccefbcf 100644 --- a/docs/docs/docs/LibraryIntegrations.md +++ b/docs/docs/docs/LibraryIntegrations.md @@ -81,7 +81,7 @@ object MyTest extends SimpleIOSuite { Differ instances for cats data structures like `NonEmptyList` and `Chain` can be found in ``` -"com.github.jatcwang" %% "difflicious-scalatest" % "{{ site.version }}" % Test +"com.github.jatcwang" %% "difflicious-cats" % "{{ site.version }}" % Test ``` ```scala mdoc:nest diff --git a/modules/cats/src/main/scala/difflicious/cats/CatsInstances.scala b/modules/cats/src/main/scala/difflicious/cats/CatsInstances.scala index b474723..af0fd0a 100644 --- a/modules/cats/src/main/scala/difflicious/cats/CatsInstances.scala +++ b/modules/cats/src/main/scala/difflicious/cats/CatsInstances.scala @@ -100,6 +100,22 @@ trait CatsInstances { ) } + implicit def chainDiffer[A]( + implicit aDiffer: Differ[A], + typeName: TypeName[Chain[A]], + ): SeqDiffer[Chain, A] = { + SeqDiffer.create( + itemDiffer = aDiffer, + typeName = typeName.copy( + long = "cats.data.Chain", + short = "Chain", + ), + asSeq = chainAsSeq, + ) + } + + implicit def validatedDiffer[E: Differ, A: Differ]: Differ[Validated[E, A]] = Differ.derived + } object CatsInstances extends CatsInstances