From c0cb08b3f4ab0ae5512b2327c58e8585256a6f5e Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Sun, 31 Dec 2023 12:59:40 +0900 Subject: [PATCH 01/13] enforce new wildcard syntax --- .scalafmt.conf | 5 +++++ .../src/main/scala/algebra/ring/Additive.scala | 2 +- build.sbt | 4 ++-- .../src/main/scala/cats/ApplicativeError.scala | 2 +- core/src/main/scala/cats/data/Chain.scala | 6 +++--- core/src/main/scala/cats/data/EitherT.scala | 4 ++-- core/src/main/scala/cats/data/IorT.scala | 2 +- core/src/main/scala/cats/data/Kleisli.scala | 2 +- core/src/main/scala/cats/data/OptionT.scala | 2 +- core/src/main/scala/cats/instances/try.scala | 18 +++++++++--------- .../scala/cats/syntax/applicativeError.scala | 2 +- core/src/main/scala/cats/syntax/either.scala | 2 +- .../main/scala/cats/syntax/monadError.scala | 4 ++-- core/src/main/scala/cats/syntax/option.scala | 2 +- .../src/main/scala/cats/syntax/validated.scala | 2 +- .../main/scala/cats/free/FreeApplicative.scala | 4 ++-- .../src/main/scala/cats/kernel/Semigroup.scala | 4 ++-- .../test/scala/cats/tests/EitherSuite.scala | 6 +++--- 18 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 348d8240c0..6936060968 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -26,3 +26,8 @@ fileOverride { project.excludeFilters = [ "scalafix/*" ] +rewrite.scala3.convertToNewSyntax = true +runner.dialectOverride.allowSignificantIndentation = false +runner.dialectOverride.allowAsForImportRename = false +runner.dialectOverride.allowStarWildcardImport = false +runner.dialectOverride.allowPostfixStarVarargSplices = false diff --git a/algebra-core/src/main/scala/algebra/ring/Additive.scala b/algebra-core/src/main/scala/algebra/ring/Additive.scala index 94d3081d4c..dba76626e1 100644 --- a/algebra-core/src/main/scala/algebra/ring/Additive.scala +++ b/algebra-core/src/main/scala/algebra/ring/Additive.scala @@ -155,7 +155,7 @@ trait AdditiveCommutativeGroup[@sp(Int, Long, Float, Double) A] trait AdditiveSemigroupFunctions[S[T] <: AdditiveSemigroup[T]] { def isAdditiveCommutative[A](implicit ev: S[A]): Boolean = - ev.isInstanceOf[AdditiveCommutativeSemigroup[_]] + ev.isInstanceOf[AdditiveCommutativeSemigroup[?]] def plus[@sp(Int, Long, Float, Double) A](x: A, y: A)(implicit ev: S[A]): A = ev.plus(x, y) diff --git a/build.sbt b/build.sbt index a4c074f4a4..7435e94297 100644 --- a/build.sbt +++ b/build.sbt @@ -121,12 +121,12 @@ lazy val kernelLaws = crossProject(JSPlatform, JVMPlatform, NativePlatform) .jvmSettings(commonJvmSettings) .nativeSettings(commonNativeSettings) -lazy val algebraSettings = Seq[Setting[_]]( +lazy val algebraSettings = Seq[Setting[?]]( tlMimaPreviousVersions += "2.2.3", tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "2.7.0").toMap ) -lazy val algebraNativeSettings = Seq[Setting[_]]( +lazy val algebraNativeSettings = Seq[Setting[?]]( tlMimaPreviousVersions ~= (_ - "2.2.3"), tlVersionIntroduced += ("3" -> "2.8.0") ) diff --git a/core/src/main/scala/cats/ApplicativeError.scala b/core/src/main/scala/cats/ApplicativeError.scala index 624a9c32e9..7582fca4ed 100644 --- a/core/src/main/scala/cats/ApplicativeError.scala +++ b/core/src/main/scala/cats/ApplicativeError.scala @@ -365,7 +365,7 @@ object ApplicativeError { def apply[F[_], E](implicit F: ApplicativeError[F, E]): ApplicativeError[F, E] = F final private[cats] class LiftFromOptionPartially[F[_]](private val dummy: Boolean = true) extends AnyVal { - def apply[E, A](oa: Option[A], ifEmpty: => E)(implicit F: ApplicativeError[F, _ >: E]): F[A] = + def apply[E, A](oa: Option[A], ifEmpty: => E)(implicit F: ApplicativeError[F, ? >: E]): F[A] = oa match { case Some(a) => F.pure(a) case None => F.raiseError(ifEmpty) diff --git a/core/src/main/scala/cats/data/Chain.scala b/core/src/main/scala/cats/data/Chain.scala index b8b882e8b4..69c0d2da5e 100644 --- a/core/src/main/scala/cats/data/Chain.scala +++ b/core/src/main/scala/cats/data/Chain.scala @@ -165,7 +165,7 @@ sealed abstract class Chain[+A] extends ChainCompat[A] { /** * Returns true if there are no elements in this collection. */ - def isEmpty: Boolean = !this.isInstanceOf[Chain.NonEmpty[_]] + def isEmpty: Boolean = !this.isInstanceOf[Chain.NonEmpty[?]] /** * Returns false if there are no elements in this collection. @@ -174,7 +174,7 @@ sealed abstract class Chain[+A] extends ChainCompat[A] { // Quick check whether the chain is either empty or contains one element only. @inline private def isEmptyOrSingleton: Boolean = - isEmpty || this.isInstanceOf[Chain.Singleton[_]] + isEmpty || this.isInstanceOf[Chain.Singleton[?]] /** * Concatenates this with `c` in O(1) runtime. @@ -863,7 +863,7 @@ sealed abstract class Chain[+A] extends ChainCompat[A] { override def equals(o: Any): Boolean = o match { - case thatChain: Chain[_] => + case thatChain: Chain[?] => (this: Chain[Any]).===(thatChain: Chain[Any])(Eq.fromUniversalEquals[Any]) case _ => false } diff --git a/core/src/main/scala/cats/data/EitherT.scala b/core/src/main/scala/cats/data/EitherT.scala index 3ee00822d7..b2432c0cd5 100644 --- a/core/src/main/scala/cats/data/EitherT.scala +++ b/core/src/main/scala/cats/data/EitherT.scala @@ -150,7 +150,7 @@ final case class EitherT[F[_], A, B](value: F[Either[A, B]]) { * res0: Try[Int] = Failure(java.lang.RuntimeException: ERROR!) * }}} */ - def getOrRaise[E](e: => E)(implicit F: MonadError[F, _ >: E]): F[B] = + def getOrRaise[E](e: => E)(implicit F: MonadError[F, ? >: E]): F[B] = getOrElseF(F.raiseError(e)) /** @@ -248,7 +248,7 @@ final case class EitherT[F[_], A, B](value: F[Either[A, B]]) { * res3: util.Try[String] = Failure(java.lang.Exception: sad cats) * }}} */ - def rethrowT(implicit F: MonadError[F, _ >: A]): F[B] = + def rethrowT(implicit F: MonadError[F, ? >: A]): F[B] = F.rethrow(value) /** diff --git a/core/src/main/scala/cats/data/IorT.scala b/core/src/main/scala/cats/data/IorT.scala index 45712b664f..1b493635e9 100644 --- a/core/src/main/scala/cats/data/IorT.scala +++ b/core/src/main/scala/cats/data/IorT.scala @@ -78,7 +78,7 @@ final case class IorT[F[_], A, B](value: F[Ior[A, B]]) { * res0: Try[Int] = Failure(java.lang.RuntimeException: ERROR!) * }}} */ - def getOrRaise[E](e: => E)(implicit F: MonadError[F, _ >: E]): F[B] = + def getOrRaise[E](e: => E)(implicit F: MonadError[F, ? >: E]): F[B] = getOrElseF(F.raiseError(e)) def valueOr[BB >: B](f: A => BB)(implicit F: Functor[F], BB: Semigroup[BB]): F[BB] = F.map(value)(_.valueOr(f)) diff --git a/core/src/main/scala/cats/data/Kleisli.scala b/core/src/main/scala/cats/data/Kleisli.scala index 48a7ab34d1..ce34adc147 100644 --- a/core/src/main/scala/cats/data/Kleisli.scala +++ b/core/src/main/scala/cats/data/Kleisli.scala @@ -76,7 +76,7 @@ final case class Kleisli[F[_], -A, B](run: A => F[B]) { self => } def flatMapF[C](f: B => F[C])(implicit F: FlatMap[F]): Kleisli[F, A, C] = run match { - case run: StrictConstFunction1[_] => Kleisli(run.andThen(F.flatMap(_: F[B])(f))) + case run: StrictConstFunction1[?] => Kleisli(run.andThen(F.flatMap(_: F[B])(f))) case _ => Kleisli.shift(a => F.flatMap(run(a))(f)) } diff --git a/core/src/main/scala/cats/data/OptionT.scala b/core/src/main/scala/cats/data/OptionT.scala index 1104c65fb3..d16a09ba94 100644 --- a/core/src/main/scala/cats/data/OptionT.scala +++ b/core/src/main/scala/cats/data/OptionT.scala @@ -315,7 +315,7 @@ final case class OptionT[F[_], A](value: F[Option[A]]) { * res0: Try[Int] = Failure(java.lang.RuntimeException: ERROR!) * }}} */ - def getOrRaise[E](e: => E)(implicit F: MonadError[F, _ >: E]): F[A] = + def getOrRaise[E](e: => E)(implicit F: MonadError[F, ? >: E]): F[A] = getOrElseF(F.raiseError(e)) /** diff --git a/core/src/main/scala/cats/instances/try.scala b/core/src/main/scala/cats/instances/try.scala index 6eb96ca9cf..49c39cd74a 100644 --- a/core/src/main/scala/cats/instances/try.scala +++ b/core/src/main/scala/cats/instances/try.scala @@ -37,20 +37,20 @@ trait TryInstances extends TryInstances1 { override def product[A, B](ta: Try[A], tb: Try[B]): Try[(A, B)] = (ta, tb) match { case (Success(a), Success(b)) => Success((a, b)) - case (f: Failure[_], _) => castFailure[(A, B)](f) - case (_, f: Failure[_]) => castFailure[(A, B)](f) + case (f: Failure[?], _) => castFailure[(A, B)](f) + case (_, f: Failure[?]) => castFailure[(A, B)](f) } override def map2[A, B, Z](ta: Try[A], tb: Try[B])(f: (A, B) => Z): Try[Z] = (ta, tb) match { case (Success(a), Success(b)) => Try(f(a, b)) - case (f: Failure[_], _) => castFailure[Z](f) - case (_, f: Failure[_]) => castFailure[Z](f) + case (f: Failure[?], _) => castFailure[Z](f) + case (_, f: Failure[?]) => castFailure[Z](f) } override def map2Eval[A, B, Z](ta: Try[A], tb: Eval[Try[B]])(f: (A, B) => Z): Eval[Try[Z]] = ta match { - case f: Failure[_] => Now(castFailure[Z](f)) + case f: Failure[?] => Now(castFailure[Z](f)) case Success(a) => tb.map(_.map(f(a, _))) } @@ -71,7 +71,7 @@ trait TryInstances extends TryInstances1 { def traverse[G[_], A, B](fa: Try[A])(f: A => G[B])(implicit G: Applicative[G]): G[Try[B]] = fa match { case Success(a) => G.map(f(a))(Success(_)) - case f: Failure[_] => G.pure(castFailure[B](f)) + case f: Failure[?] => G.pure(castFailure[B](f)) } override def mapAccumulate[S, A, B](init: S, fa: Try[A])(f: (S, A) => (S, B)): (S, Try[B]) = { @@ -79,13 +79,13 @@ trait TryInstances extends TryInstances1 { case Success(a) => val (snext, b) = f(init, a) (snext, Success(b)) - case f: Failure[_] => (init, castFailure[B](f)) + case f: Failure[?] => (init, castFailure[B](f)) } } @tailrec final def tailRecM[B, C](b: B)(f: B => Try[Either[B, C]]): Try[C] = f(b) match { - case f: Failure[_] => castFailure[C](f) + case f: Failure[?] => castFailure[C](f) case Success(Left(b1)) => tailRecM(b1)(f) case Success(Right(c)) => Success(c) } @@ -200,7 +200,7 @@ private[instances] object TryInstances { * A `Failure` can be statically typed as `Try[A]` for all `A`, because it * does not actually contain an `A` value (as `Success[A]` does). */ - @inline final def castFailure[A](f: Failure[_]): Try[A] = f.asInstanceOf[Try[A]] + @inline final def castFailure[A](f: Failure[?]): Try[A] = f.asInstanceOf[Try[A]] } sealed private[instances] trait TryInstances1 extends TryInstances2 { diff --git a/core/src/main/scala/cats/syntax/applicativeError.scala b/core/src/main/scala/cats/syntax/applicativeError.scala index 402c9f719a..352658fc8e 100644 --- a/core/src/main/scala/cats/syntax/applicativeError.scala +++ b/core/src/main/scala/cats/syntax/applicativeError.scala @@ -63,7 +63,7 @@ final private[syntax] class ApplicativeErrorExtensionOps[F[_], E](F: Applicative } final class ApplicativeErrorIdOps[E](private val e: E) extends AnyVal { - def raiseError[F[_], A](implicit F: ApplicativeError[F, _ >: E]): F[A] = + def raiseError[F[_], A](implicit F: ApplicativeError[F, ? >: E]): F[A] = F.raiseError(e) } diff --git a/core/src/main/scala/cats/syntax/either.scala b/core/src/main/scala/cats/syntax/either.scala index 2a39e65963..a4361545c0 100644 --- a/core/src/main/scala/cats/syntax/either.scala +++ b/core/src/main/scala/cats/syntax/either.scala @@ -352,7 +352,7 @@ final class EitherOps[A, B](private val eab: Either[A, B]) extends AnyVal { * res0: cats.data.EitherT[Option, CharSequence, Int] = EitherT(Some(Right(3))) * }}} */ - def liftTo[F[_]](implicit F: ApplicativeError[F, _ >: A]): F[B] = F.fromEither(eab) + def liftTo[F[_]](implicit F: ApplicativeError[F, ? >: A]): F[B] = F.fromEither(eab) } final class EitherObjectOps(private val either: Either.type) extends AnyVal { diff --git a/core/src/main/scala/cats/syntax/monadError.scala b/core/src/main/scala/cats/syntax/monadError.scala index a3a858995a..5b13b52059 100644 --- a/core/src/main/scala/cats/syntax/monadError.scala +++ b/core/src/main/scala/cats/syntax/monadError.scala @@ -28,7 +28,7 @@ trait MonadErrorSyntax { implicit final def catsSyntaxMonadErrorRethrow[F[_], E, A]( fea: F[Either[E, A]] - )(implicit F: MonadError[F, _ >: E]): MonadErrorRethrowOps[F, E, A] = + )(implicit F: MonadError[F, ? >: E]): MonadErrorRethrowOps[F, E, A] = new MonadErrorRethrowOps(fea) } @@ -59,7 +59,7 @@ final class MonadErrorOps[F[_], E, A](private val fa: F[A]) extends AnyVal { } final class MonadErrorRethrowOps[F[_], E, A](private val fea: F[Either[E, A]]) extends AnyVal { - def rethrow(implicit F: MonadError[F, _ >: E]): F[A] = + def rethrow(implicit F: MonadError[F, ? >: E]): F[A] = F.flatMap(fea)( _.fold(F.raiseError, F.pure) ) // dup from the type class impl, due to https://github.com/scala/bug/issues/11562. Once fixed should be able to replace with `F.rethrow(fea)` diff --git a/core/src/main/scala/cats/syntax/option.scala b/core/src/main/scala/cats/syntax/option.scala index d62073cdf6..16cc8a3270 100644 --- a/core/src/main/scala/cats/syntax/option.scala +++ b/core/src/main/scala/cats/syntax/option.scala @@ -391,7 +391,7 @@ final class OptionOps[A](private val oa: Option[A]) extends AnyVal { object OptionOps { final class LiftToPartiallyApplied[F[_], A](oa: Option[A]) { - def apply[E](ifEmpty: => E)(implicit F: ApplicativeError[F, _ >: E]): F[A] = + def apply[E](ifEmpty: => E)(implicit F: ApplicativeError[F, ? >: E]): F[A] = ApplicativeError.liftFromOption(oa, ifEmpty) } } diff --git a/core/src/main/scala/cats/syntax/validated.scala b/core/src/main/scala/cats/syntax/validated.scala index 68b386b8e1..68cc1bdda9 100644 --- a/core/src/main/scala/cats/syntax/validated.scala +++ b/core/src/main/scala/cats/syntax/validated.scala @@ -41,7 +41,7 @@ trait ValidatedExtensionSyntax { } final class ValidatedExtension[E, A](private val self: Validated[E, A]) extends AnyVal { - def liftTo[F[_]](implicit F: ApplicativeError[F, _ >: E]): F[A] = + def liftTo[F[_]](implicit F: ApplicativeError[F, ? >: E]): F[A] = F.fromValidated(self) } diff --git a/free/src/main/scala/cats/free/FreeApplicative.scala b/free/src/main/scala/cats/free/FreeApplicative.scala index fdb0f9d1cf..93e22a8304 100644 --- a/free/src/main/scala/cats/free/FreeApplicative.scala +++ b/free/src/main/scala/cats/free/FreeApplicative.scala @@ -80,7 +80,7 @@ sealed abstract class FreeApplicative[F[_], A] extends Product with Serializable argsFLength -= 1 // rip off every `Ap` in `argF` in function position - if (argF.isInstanceOf[Ap[F, _, _]]) { + if (argF.isInstanceOf[Ap[F, ?, ?]]) { val lengthInitial = argsFLength // reassociate the functions into a single fn, // and move the arguments into argsF @@ -89,7 +89,7 @@ sealed abstract class FreeApplicative[F[_], A] extends Product with Serializable argsF ::= ap.fp argsFLength += 1 argF = ap.fn.asInstanceOf[FA[F, Any]] - argF.isInstanceOf[Ap[F, _, _]] + argF.isInstanceOf[Ap[F, ?, ?]] }) () // consecutive `ap` calls have been queued as operations; // argF is no longer an `Ap` node, so the entire topmost left-associated diff --git a/kernel/src/main/scala/cats/kernel/Semigroup.scala b/kernel/src/main/scala/cats/kernel/Semigroup.scala index 75291f54ff..e861f481fe 100644 --- a/kernel/src/main/scala/cats/kernel/Semigroup.scala +++ b/kernel/src/main/scala/cats/kernel/Semigroup.scala @@ -140,10 +140,10 @@ abstract class SemigroupFunctions[S[T] <: Semigroup[T]] { } def isCommutative[A](implicit ev: S[A]): Boolean = - ev.isInstanceOf[CommutativeSemigroup[_]] + ev.isInstanceOf[CommutativeSemigroup[?]] def isIdempotent[A](implicit ev: S[A]): Boolean = - ev.isInstanceOf[Band[_]] + ev.isInstanceOf[Band[?]] def combineN[@sp(Int, Long, Float, Double) A](a: A, n: Int)(implicit ev: S[A]): A = ev.combineN(a, n) diff --git a/tests/shared/src/test/scala/cats/tests/EitherSuite.scala b/tests/shared/src/test/scala/cats/tests/EitherSuite.scala index 851eec7901..eca7b226e7 100644 --- a/tests/shared/src/test/scala/cats/tests/EitherSuite.scala +++ b/tests/shared/src/test/scala/cats/tests/EitherSuite.scala @@ -108,9 +108,9 @@ class EitherSuite extends CatsSuite { test("implicit instances resolve specifically") { val eq = cats.kernel.instances.either.catsStdEqForEither[Int, String] - assert(!eq.isInstanceOf[PartialOrder[_]]) - assert(!eq.isInstanceOf[Order[_]]) - assert(!partialOrder.isInstanceOf[Order[_]]) + assert(!eq.isInstanceOf[PartialOrder[?]]) + assert(!eq.isInstanceOf[Order[?]]) + assert(!partialOrder.isInstanceOf[Order[?]]) } test("show isn't empty") { From 64a81ee5cb7f8cd90a5549312ce0821d093bae4f Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 11:15:13 +0000 Subject: [PATCH 02/13] Update sbt-typelevel, sbt-typelevel-site to 0.6.5 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index b86eee79cf..32f489b3a4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -val sbtTypelevelVersion = "0.6.4" +val sbtTypelevelVersion = "0.6.5" addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtTypelevelVersion) addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion) addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") From afd6d007d4e33b179b357b25e53e95d1bbd3f093 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 11:16:49 +0000 Subject: [PATCH 03/13] Run prePR with sbt-typelevel Executed command: sbt tlPrePrBotHook --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 127e2f1529..f8223cdc2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,7 +131,7 @@ jobs: - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }} path: targets.tar @@ -191,7 +191,7 @@ jobs: run: sbt +update - name: Download target directories (2.12, rootJS) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS @@ -201,7 +201,7 @@ jobs: rm targets.tar - name: Download target directories (2.12, rootJVM) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM @@ -211,7 +211,7 @@ jobs: rm targets.tar - name: Download target directories (2.12, rootNative) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootNative @@ -221,7 +221,7 @@ jobs: rm targets.tar - name: Download target directories (2.13, rootJS) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS @@ -231,7 +231,7 @@ jobs: rm targets.tar - name: Download target directories (2.13, rootJVM) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM @@ -241,7 +241,7 @@ jobs: rm targets.tar - name: Download target directories (2.13, rootNative) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative @@ -251,7 +251,7 @@ jobs: rm targets.tar - name: Download target directories (3, rootJS) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJS @@ -261,7 +261,7 @@ jobs: rm targets.tar - name: Download target directories (3, rootJVM) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJVM @@ -271,7 +271,7 @@ jobs: rm targets.tar - name: Download target directories (3, rootNative) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootNative From 396b3173369e6f34760bc9ec7d7b40a0a7347b0e Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Tue, 9 Jan 2024 21:07:44 +0900 Subject: [PATCH 04/13] fix MonadOps.scala and FunctionKMacros.scala dir --- .../scala-2/{src/main/scala => }/cats/arrow/FunctionKMacros.scala | 0 .../main/scala-2/{src/main/scala => }/cats/syntax/MonadOps.scala | 0 .../scala-3/{src/main/scala => }/cats/arrow/FunctionKMacros.scala | 0 .../main/scala-3/{src/main/scala => }/cats/syntax/MonadOps.scala | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename core/src/main/scala-2/{src/main/scala => }/cats/arrow/FunctionKMacros.scala (100%) rename core/src/main/scala-2/{src/main/scala => }/cats/syntax/MonadOps.scala (100%) rename core/src/main/scala-3/{src/main/scala => }/cats/arrow/FunctionKMacros.scala (100%) rename core/src/main/scala-3/{src/main/scala => }/cats/syntax/MonadOps.scala (100%) diff --git a/core/src/main/scala-2/src/main/scala/cats/arrow/FunctionKMacros.scala b/core/src/main/scala-2/cats/arrow/FunctionKMacros.scala similarity index 100% rename from core/src/main/scala-2/src/main/scala/cats/arrow/FunctionKMacros.scala rename to core/src/main/scala-2/cats/arrow/FunctionKMacros.scala diff --git a/core/src/main/scala-2/src/main/scala/cats/syntax/MonadOps.scala b/core/src/main/scala-2/cats/syntax/MonadOps.scala similarity index 100% rename from core/src/main/scala-2/src/main/scala/cats/syntax/MonadOps.scala rename to core/src/main/scala-2/cats/syntax/MonadOps.scala diff --git a/core/src/main/scala-3/src/main/scala/cats/arrow/FunctionKMacros.scala b/core/src/main/scala-3/cats/arrow/FunctionKMacros.scala similarity index 100% rename from core/src/main/scala-3/src/main/scala/cats/arrow/FunctionKMacros.scala rename to core/src/main/scala-3/cats/arrow/FunctionKMacros.scala diff --git a/core/src/main/scala-3/src/main/scala/cats/syntax/MonadOps.scala b/core/src/main/scala-3/cats/syntax/MonadOps.scala similarity index 100% rename from core/src/main/scala-3/src/main/scala/cats/syntax/MonadOps.scala rename to core/src/main/scala-3/cats/syntax/MonadOps.scala From 6f2ab2d8c8f48811411fb887257fb141bd415971 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 20:04:51 +0000 Subject: [PATCH 05/13] Update nscplugin, sbt-scala-native, ... to 0.4.17 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 32f489b3a4..78220dbe79 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,5 +4,5 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion) addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.10.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.14.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.16") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") From b8cb620a79ae2f4f54fbed6dde20ed4950b0f792 Mon Sep 17 00:00:00 2001 From: Vince Date: Sat, 20 Jan 2024 12:39:05 +0100 Subject: [PATCH 06/13] fix wording at end of Semigroup doc --- docs/typeclasses/semigroup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/typeclasses/semigroup.md b/docs/typeclasses/semigroup.md index 0da4361b16..e0e90a1c7e 100644 --- a/docs/typeclasses/semigroup.md +++ b/docs/typeclasses/semigroup.md @@ -169,7 +169,7 @@ def combineAll[A: Semigroup](as: List[A]): A = ``` `Semigroup` isn't powerful enough for us to implement this function - namely, it doesn't give us an identity -or fallback value if the list is empty. We need a power expressive abstraction, which we can find in the +or fallback value if the list is empty. We need a more powerfully expressive abstraction, which we can find in the `Monoid` type class. N.B. From 1ee90d16984bbe6e0df73a8c8780a5441f1d291b Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Wed, 24 Jan 2024 16:06:04 +0000 Subject: [PATCH 07/13] Update sbt-scalajs, scalajs-compiler, ... to 1.15.0 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 78220dbe79..67dc6448fb 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,6 +3,6 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtTypelevelVersion) addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion) addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.10.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.14.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") From d09a56b2281d0d0e9f7c8bfd285e277116470409 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:04:32 +0000 Subject: [PATCH 08/13] Update munit to 1.0.0-M11 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 7435e94297..1ce4be34dc 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ val disciplineVersion = "1.5.1" val disciplineMunitVersion = "2.0.0-M3" -val munitVersion = "1.0.0-M10" +val munitVersion = "1.0.0-M11" val PrimaryJava = JavaSpec.temurin("8") val LTSJava = JavaSpec.temurin("17") From 5b57d5d09cba065142e1cca205e805dda532ed17 Mon Sep 17 00:00:00 2001 From: Andrew Valencik Date: Sat, 3 Feb 2024 15:13:59 -0500 Subject: [PATCH 09/13] Use `Applicative#unit` in `Foldable#traverse_` --- core/src/main/scala/cats/Foldable.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/cats/Foldable.scala b/core/src/main/scala/cats/Foldable.scala index 259f581651..c7ecdd326a 100644 --- a/core/src/main/scala/cats/Foldable.scala +++ b/core/src/main/scala/cats/Foldable.scala @@ -589,7 +589,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s * needed. */ def traverse_[G[_], A, B](fa: F[A])(f: A => G[B])(implicit G: Applicative[G]): G[Unit] = - foldRight(fa, Always(G.pure(()))) { (a, acc) => + foldRight(fa, Always(G.unit)) { (a, acc) => G.map2Eval(f(a), acc) { (_, _) => () } From a97b299b967816902b2f9235b25abd4851d03752 Mon Sep 17 00:00:00 2001 From: satorg Date: Sat, 3 Feb 2024 13:42:58 -0800 Subject: [PATCH 10/13] replace other `Applicative.pure(())` with `.unit` --- free/src/test/scala/cats/free/FreeTSuite.scala | 14 +++++++------- .../src/main/scala/cats/laws/ApplicativeLaws.scala | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/free/src/test/scala/cats/free/FreeTSuite.scala b/free/src/test/scala/cats/free/FreeTSuite.scala index 4916ecf040..fa1a538b1b 100644 --- a/free/src/test/scala/cats/free/FreeTSuite.scala +++ b/free/src/test/scala/cats/free/FreeTSuite.scala @@ -72,7 +72,7 @@ class FreeTSuite extends CatsSuite { checkAll("FreeT[Option, Option, Int", DeferTests[FreeTOption].defer[Int]) test("FlatMap stack safety tested with 50k flatMaps") { - val expected = Applicative[FreeTOption].pure(()) + val expected = Applicative[FreeTOption].unit val result = Monad[FreeTOption].tailRecM(0)((i: Int) => if (i < 50000) @@ -85,9 +85,9 @@ class FreeTSuite extends CatsSuite { } test("Stack safe with 50k left-associated flatMaps") { - val expected = Applicative[FreeTOption].pure(()) + val expected = Applicative[FreeTOption].unit val result = - (0 until 50000).foldLeft(Applicative[FreeTOption].pure(()))((fu, i) => + (0 until 50000).foldLeft(Applicative[FreeTOption].unit)((fu, i) => fu.flatMap(u => Applicative[FreeTOption].pure(u)) ) @@ -95,7 +95,7 @@ class FreeTSuite extends CatsSuite { } test("Stack safe with flatMap followed by 50k maps") { - val expected = Applicative[FreeTOption].pure(()) + val expected = Applicative[FreeTOption].unit val result = (0 until 50000).foldLeft(().pure[FreeTOption].flatMap(_.pure[FreeTOption]))((fu, i) => fu.map(identity)) @@ -110,7 +110,7 @@ class FreeTSuite extends CatsSuite { } test("mapK stack-safety") { - val a = (0 until 50000).foldLeft(Applicative[FreeTOption].pure(()))((fu, i) => + val a = (0 until 50000).foldLeft(Applicative[FreeTOption].unit)((fu, i) => fu.flatMap(u => Applicative[FreeTOption].pure(u)) ) val b = a.mapK(FunctionK.id) @@ -126,7 +126,7 @@ class FreeTSuite extends CatsSuite { } test("compile stack-safety") { - val a = (0 until 50000).foldLeft(Applicative[FreeTOption].pure(()))((fu, i) => + val a = (0 until 50000).foldLeft(Applicative[FreeTOption].unit)((fu, i) => fu.flatMap(u => Applicative[FreeTOption].pure(u)) ) val b = a.compile(FunctionK.id) // used to overflow @@ -147,7 +147,7 @@ class FreeTSuite extends CatsSuite { type F[A] = FreeT[Id, Option, A] val F = MonadError[F, Unit] - val eff = F.flatMap(F.pure(()))(_ => F.raiseError[String](())) + val eff = F.flatMap(F.unit)(_ => F.raiseError[String](())) assert(F.attempt(eff).runM(Some(_)) === Some(Left(()))) } diff --git a/laws/src/main/scala/cats/laws/ApplicativeLaws.scala b/laws/src/main/scala/cats/laws/ApplicativeLaws.scala index d2538fcc94..a0109f7d0f 100644 --- a/laws/src/main/scala/cats/laws/ApplicativeLaws.scala +++ b/laws/src/main/scala/cats/laws/ApplicativeLaws.scala @@ -66,10 +66,10 @@ trait ApplicativeLaws[F[_]] extends ApplyLaws[F] { // Semigroupal's associativity law. def monoidalLeftIdentity[A](fa: F[A]): (F[(Unit, A)], F[A]) = - (F.product(F.pure(()), fa), fa) + (F.product(F.unit, fa), fa) def monoidalRightIdentity[A](fa: F[A]): (F[(A, Unit)], F[A]) = - (F.product(fa, F.pure(())), fa) + (F.product(fa, F.unit), fa) } object ApplicativeLaws { From b86be19a7c678c9eed3a9e387773a117330c8fc4 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Sun, 18 Feb 2024 04:06:38 +0000 Subject: [PATCH 11/13] Update sbt-typelevel, sbt-typelevel-site to 0.6.6 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 67dc6448fb..29ac58d65f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -val sbtTypelevelVersion = "0.6.5" +val sbtTypelevelVersion = "0.6.6" addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtTypelevelVersion) addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion) addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") From 3bb6fe2a97230bb8e6225dae90c7fd932a33870a Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 20:04:40 +0000 Subject: [PATCH 12/13] Update scalafmt-core to 3.8.0 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 6936060968..4e92dc6e20 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version=3.7.17 +version=3.8.0 align.openParenCallSite = true align.openParenDefnSite = true maxColumn = 120 From c807351dadabb8bb36802c15b6e38405fd173d22 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 08:06:29 +0000 Subject: [PATCH 13/13] Update sbt to 1.9.9 --- project/build.properties | 2 +- scalafix/project/build.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/project/build.properties b/project/build.properties index abbbce5da4..04267b14af 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.9.9 diff --git a/scalafix/project/build.properties b/scalafix/project/build.properties index abbbce5da4..04267b14af 100644 --- a/scalafix/project/build.properties +++ b/scalafix/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.9.9