From e5cb750aa53d122c8ef8ef73f6862d85de25fd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20G=2E=20Stan?= Date: Mon, 17 Jun 2024 14:39:43 +0300 Subject: [PATCH 1/2] Add `reverse` on the Semigroup companion object --- kernel/src/main/scala/cats/kernel/Semigroup.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/src/main/scala/cats/kernel/Semigroup.scala b/kernel/src/main/scala/cats/kernel/Semigroup.scala index e861f481fe..6aabbb38b6 100644 --- a/kernel/src/main/scala/cats/kernel/Semigroup.scala +++ b/kernel/src/main/scala/cats/kernel/Semigroup.scala @@ -178,6 +178,8 @@ object Semigroup */ @inline def last[A]: Semigroup[A] = (_, y) => y + @inline def reverse[A](implicit ev: Semigroup[A]): Semigroup[A] = ev.reverse + implicit def catsKernelBoundedSemilatticeForBitSet: BoundedSemilattice[BitSet] = cats.kernel.instances.bitSet.catsKernelStdSemilatticeForBitSet implicit def catsKernelInstancesForUnit: BoundedSemilattice[Unit] with CommutativeGroup[Unit] = From 99714f127b06305f64e4f4dd8f55dca7ae69efe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20G=2E=20Stan?= Date: Mon, 17 Jun 2024 14:40:12 +0300 Subject: [PATCH 2/2] Add `intercalate` on the Semigroup companion object --- kernel/src/main/scala/cats/kernel/Semigroup.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/src/main/scala/cats/kernel/Semigroup.scala b/kernel/src/main/scala/cats/kernel/Semigroup.scala index 6aabbb38b6..d690e77697 100644 --- a/kernel/src/main/scala/cats/kernel/Semigroup.scala +++ b/kernel/src/main/scala/cats/kernel/Semigroup.scala @@ -180,6 +180,9 @@ object Semigroup @inline def reverse[A](implicit ev: Semigroup[A]): Semigroup[A] = ev.reverse + @inline def intercalate[A](sep: A)(implicit ev: Semigroup[A]): Semigroup[A] = + ev.intercalate(sep) + implicit def catsKernelBoundedSemilatticeForBitSet: BoundedSemilattice[BitSet] = cats.kernel.instances.bitSet.catsKernelStdSemilatticeForBitSet implicit def catsKernelInstancesForUnit: BoundedSemilattice[Unit] with CommutativeGroup[Unit] =