Skip to content

Commit dd1d080

Browse files
authored
Merge pull request #4902 from xuwei-k/implicit-using
Fix warnings with Scala 3.9
2 parents f0c5f1b + 18d8e73 commit dd1d080

61 files changed

Lines changed: 219 additions & 215 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ class NonEmptyLazyListOps[A](private val value: NonEmptyLazyList[A])
375375
*/
376376
final def sortBy[B](f: A => B)(implicit B: Order[B]): NonEmptyLazyList[A] =
377377
// safe: sorting a NonEmptyList cannot produce an empty List
378-
create(toLazyList.sortBy(f)(B.toOrdering))
378+
create(toLazyList.sortBy(f)(using B.toOrdering))
379379

380380
/**
381381
* Sorts this `NonEmptyList` according to an `Order`
@@ -389,7 +389,7 @@ class NonEmptyLazyListOps[A](private val value: NonEmptyLazyList[A])
389389
* }}}
390390
*/
391391
final def sorted[AA >: A](implicit AA: Order[AA]): NonEmptyLazyList[AA] =
392-
create(toLazyList.sorted(AA.toOrdering))
392+
create(toLazyList.sorted(using AA.toOrdering))
393393

394394
/**
395395
* Groups elements inside this `NonEmptyLazyList` according to the `Order`
@@ -564,7 +564,7 @@ sealed abstract private[data] class NonEmptyLazyListInstances extends NonEmptyLa
564564
type F[x] = OneAnd[ZipLazyList, x]
565565

566566
def applicative: Applicative[OneAnd[ZipLazyList, *]] =
567-
OneAnd.catsDataApplicativeForOneAnd(ZipLazyList.catsDataAlternativeForZipLazyList)
567+
OneAnd.catsDataApplicativeForOneAnd(using ZipLazyList.catsDataAlternativeForZipLazyList)
568568
def monad: Monad[NonEmptyLazyList] = NonEmptyLazyList.catsDataInstancesForNonEmptyLazyList
569569

570570
def sequential: OneAnd[ZipLazyList, *] ~> NonEmptyLazyList =

‎core/src/main/scala-2.13+/cats/data/OneAndLowPriority4.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ abstract private[data] class OneAndLowPriority4 {
4343
fa.head
4444

4545
def map[A, B](fa: OneAnd[Stream, A])(f: A => B): OneAnd[Stream, B] =
46-
fa.map(f)(cats.instances.stream.catsStdInstancesForStream)
46+
fa.map(f)(using cats.instances.stream.catsStdInstancesForStream)
4747
}
4848

4949
implicit val catsDataComonadForNonEmptyLazyList: Comonad[OneAnd[LazyList, *]] =
@@ -62,6 +62,6 @@ abstract private[data] class OneAndLowPriority4 {
6262
fa.head
6363

6464
def map[A, B](fa: OneAnd[LazyList, A])(f: A => B): OneAnd[LazyList, B] =
65-
fa.map(f)(cats.instances.lazyList.catsStdInstancesForLazyList)
65+
fa.map(f)(using cats.instances.lazyList.catsStdInstancesForLazyList)
6666
}
6767
}

‎core/src/main/scala-2.13+/cats/data/ZipLazyList.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ object ZipLazyList {
4848
}
4949

5050
implicit def catsDataEqForZipLazyList[A: Eq]: Eq[ZipLazyList[A]] =
51-
Eq.by((_: ZipLazyList[A]).value)(cats.kernel.instances.lazyList.catsKernelStdEqForLazyList[A])
51+
Eq.by((_: ZipLazyList[A]).value)(using cats.kernel.instances.lazyList.catsKernelStdEqForLazyList[A])
5252
}

‎core/src/main/scala-2.13+/cats/data/ZipStream.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ object ZipStream {
5050
}
5151

5252
implicit def catsDataEqForZipStream[A: Eq]: Eq[ZipStream[A]] =
53-
Eq.by((_: ZipStream[A]).value)(cats.kernel.instances.stream.catsKernelStdEqForStream[A])
53+
Eq.by((_: ZipStream[A]).value)(using cats.kernel.instances.stream.catsKernelStdEqForStream[A])
5454
}

‎core/src/main/scala-2.13+/cats/instances/arraySeq.scala‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ private[cats] object ArraySeqInstances {
106106
def traverse[G[_], A, B](fa: ArraySeq[A])(f: A => G[B])(implicit G: Applicative[G]): G[ArraySeq[B]] =
107107
G match {
108108
case x: StackSafeMonad[G] =>
109-
x.map(Traverse.traverseDirectly(fa.iterator)(f)(x))(_.iterator.to(ArraySeq.untagged))
109+
x.map(Traverse.traverseDirectly(fa.iterator)(f)(using x))(_.iterator.to(ArraySeq.untagged))
110110
case _ =>
111111
G.map(Chain.traverseViaChain(fa)(f))(_.iterator.to(ArraySeq.untagged))
112112

113113
}
114114

115115
override def traverseVoid[G[_], A, B](fa: ArraySeq[A])(f: A => G[B])(implicit G: Applicative[G]): G[Unit] =
116116
G match {
117-
case x: StackSafeMonad[G] => Traverse.traverseVoidDirectly(fa)(f)(x)
117+
case x: StackSafeMonad[G] => Traverse.traverseVoidDirectly(fa)(f)(using x)
118118
case _ =>
119119
foldRight(fa, Eval.now(G.unit)) { (a, acc) =>
120120
G.map2Eval(f(a), acc) { (_, _) =>
@@ -124,7 +124,7 @@ private[cats] object ArraySeqInstances {
124124
}
125125

126126
override def mapAccumulate[S, A, B](init: S, fa: ArraySeq[A])(f: (S, A) => (S, B)): (S, ArraySeq[B]) =
127-
StaticMethods.mapAccumulateFromStrictFunctor(init, fa, f)(this)
127+
StaticMethods.mapAccumulateFromStrictFunctor(init, fa, f)(using this)
128128

129129
override def mapWithIndex[A, B](fa: ArraySeq[A])(f: (A, Int) => B): ArraySeq[B] =
130130
ArraySeq.untagged.tabulate(n = fa.length) { i =>
@@ -235,7 +235,7 @@ private[cats] object ArraySeqInstances {
235235
)(f: (A) => G[Option[B]])(implicit G: Applicative[G]): G[ArraySeq[B]] =
236236
G match {
237237
case x: StackSafeMonad[G] =>
238-
x.map(TraverseFilter.traverseFilterDirectly(fa.iterator)(f)(x))(
238+
x.map(TraverseFilter.traverseFilterDirectly(fa.iterator)(f)(using x))(
239239
_.iterator.to(ArraySeq.untagged)
240240
)
241241
case _ =>

‎core/src/main/scala/cats/Alternative.scala‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ trait Alternative[F[_]] extends NonEmptyAlternative[F] with MonoidK[F] { self =>
4949
* }}}
5050
*/
5151
def unite[G[_], A](fga: F[G[A]])(implicit FM: FlatMap[F], G: Foldable[G]): F[A] =
52-
FM.flatMap(fga) { G.foldMapK(_)(pure)(self) }
52+
FM.flatMap(fga) { G.foldMapK(_)(pure)(using self) }
5353

5454
// Note: `protected` is only necessary to enforce binary compatibility
5555
// since neither `private` nor `private[cats]` work properly here.
@@ -71,8 +71,8 @@ trait Alternative[F[_]] extends NonEmptyAlternative[F] with MonoidK[F] { self =>
7171
* }}}
7272
*/
7373
def separate[G[_, _], A, B](fgab: F[G[A, B]])(implicit FM: FlatMap[F], G: Bifoldable[G]): (F[A], F[B]) = {
74-
val as = FM.flatMap(fgab)(gab => G.bifoldMap(gab)(pure, _ => empty[A])(algebra[A]))
75-
val bs = FM.flatMap(fgab)(gab => G.bifoldMap(gab)(_ => empty[B], pure)(algebra[B]))
74+
val as = FM.flatMap(fgab)(gab => G.bifoldMap(gab)(pure, _ => empty[A])(using algebra[A]))
75+
val bs = FM.flatMap(fgab)(gab => G.bifoldMap(gab)(_ => empty[B], pure)(using algebra[B]))
7676
(as, bs)
7777
}
7878

@@ -157,7 +157,7 @@ object Alternative {
157157
// Note: edited manually since seems Simulacrum is not able to handle the bin-compat redirection properly.
158158
typeClassInstance.separate[G, B, C](self.asInstanceOf[F[G[B, C]]])
159159
def separateFoldable[G[_, _], B, C](implicit ev$1: A <:< G[B, C], G: Bifoldable[G], FF: Foldable[F]): (F[B], F[C]) =
160-
typeClassInstance.separateFoldable[G, B, C](self.asInstanceOf[F[G[B, C]]])(G, FF)
160+
typeClassInstance.separateFoldable[G, B, C](self.asInstanceOf[F[G[B, C]]])(using G, FF)
161161
}
162162
trait AllOps[F[_], A] extends Ops[F, A] with NonEmptyAlternative.AllOps[F, A] with MonoidK.AllOps[F, A] {
163163
type TypeClassType <: Alternative[F]

‎core/src/main/scala/cats/Bifoldable.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ object Bifoldable extends cats.instances.NTupleBitraverseInstances {
132132
def bifoldRight[C](c: Eval[C])(f: (A, Eval[C]) => Eval[C], g: (B, Eval[C]) => Eval[C]): Eval[C] =
133133
typeClassInstance.bifoldRight[A, B, C](self, c)(f, g)
134134
def bifoldMap[C](f: A => C, g: B => C)(implicit C: Monoid[C]): C =
135-
typeClassInstance.bifoldMap[A, B, C](self)(f, g)(C)
136-
def bifold(implicit A: Monoid[A], B: Monoid[B]): (A, B) = typeClassInstance.bifold[A, B](self)(A, B)
135+
typeClassInstance.bifoldMap[A, B, C](self)(f, g)(using C)
136+
def bifold(implicit A: Monoid[A], B: Monoid[B]): (A, B) = typeClassInstance.bifold[A, B](self)(using A, B)
137137
}
138138
trait AllOps[F[_, _], A, B] extends Ops[F, A, B]
139139
trait ToBifoldableOps extends Serializable {

‎core/src/main/scala/cats/ContravariantSemigroupal.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ object ContravariantSemigroupal extends SemigroupalArityFunctions {
8383

8484
private[cats] class ContravariantSemigroupalSemigroup[F[_], A](f: ContravariantSemigroupal[F]) extends Semigroup[F[A]] {
8585
def combine(a: F[A], b: F[A]): F[A] =
86-
ContravariantSemigroupal.contramap2(a, b)((a: A) => (a, a))(f, f)
86+
ContravariantSemigroupal.contramap2(a, b)((a: A) => (a, a))(using f, f)
8787
}

‎core/src/main/scala/cats/Foldable.scala‎

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
122122
case None => gb
123123
}
124124
}
125-
Defer[G].defer(loop(Source.fromFoldable(fa)(self)))
125+
Defer[G].defer(loop(Source.fromFoldable(fa)(using self)))
126126
}
127127

128128
def reduceLeftToOption[A, B](fa: F[A])(f: A => B)(g: (B, A) => B): Option[B] =
@@ -132,7 +132,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
132132
}
133133

134134
def reduceRightToOption[A, B](fa: F[A])(f: A => B)(g: (A, Eval[B]) => Eval[B]): Eval[Option[B]] = {
135-
Source.fromFoldable(fa)(self).uncons match {
135+
Source.fromFoldable(fa)(using self).uncons match {
136136
case Some((first, s)) =>
137137
def loop(now: A, source: Source[A]): Eval[B] =
138138
source.uncons match {
@@ -241,7 +241,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
241241
* @see [[maximumByOption]] for maximum instead of minimum.
242242
*/
243243
def minimumByOption[A, B: Order](fa: F[A])(f: A => B): Option[A] =
244-
minimumOption(fa)(Order.by(f))
244+
minimumOption(fa)(using Order.by(f))
245245

246246
/**
247247
* Find the maximum `A` item in this structure according to an `Order.by(f)`.
@@ -255,7 +255,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
255255
* @see [[minimumByOption]] for minimum instead of maximum.
256256
*/
257257
def maximumByOption[A, B: Order](fa: F[A])(f: A => B): Option[A] =
258-
maximumOption(fa)(Order.by(f))
258+
maximumOption(fa)(using Order.by(f))
259259

260260
/**
261261
* Find all the minimum `A` items in this structure.
@@ -299,7 +299,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
299299
* @see [[maximumByList]] for maximum instead of minimum.
300300
*/
301301
def minimumByList[A, B: Order](fa: F[A])(f: A => B): List[A] =
302-
minimumList(fa)(Order.by(f))
302+
minimumList(fa)(using Order.by(f))
303303

304304
/**
305305
* Find all the maximum `A` items in this structure according to an `Order.by(f)`.
@@ -311,7 +311,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
311311
* @see [[minimumByList]] for minimum instead of maximum.
312312
*/
313313
def maximumByList[A, B: Order](fa: F[A])(f: A => B): List[A] =
314-
maximumList(fa)(Order.by(f))
314+
maximumList(fa)(using Order.by(f))
315315

316316
def sumAll[A](fa: F[A])(implicit A: Numeric[A]): A =
317317
foldLeft(fa, A.zero)(A.plus)
@@ -390,7 +390,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
390390
*/
391391

392392
def collectFirstSomeM[G[_], A, B](fa: F[A])(f: A => G[Option[B]])(implicit G: Monad[G]): G[Option[B]] =
393-
G.tailRecM(Foldable.Source.fromFoldable(fa)(self))(_.uncons match {
393+
G.tailRecM(Foldable.Source.fromFoldable(fa)(using self))(_.uncons match {
394394
case Some((a, src)) =>
395395
G.map(f(a)) {
396396
case None => Left(src.value)
@@ -474,7 +474,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
474474
* in terms of `foldRight`.
475475
*/
476476
def foldM[G[_], A, B](fa: F[A], z: B)(f: (B, A) => G[B])(implicit G: Monad[G]): G[B] = {
477-
val src = Foldable.Source.fromFoldable(fa)(self)
477+
val src = Foldable.Source.fromFoldable(fa)(using self)
478478
G.tailRecM((z, src)) { case (b, src) =>
479479
src.uncons match {
480480
case Some((a, src)) => G.map(f(b, a))(b => Left((b, src.value)))
@@ -647,7 +647,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
647647
* }}}
648648
*/
649649
def foldK[G[_], A](fga: F[G[A]])(implicit G: MonoidK[G]): G[A] =
650-
fold(fga)(G.algebra)
650+
fold(fga)(using G.algebra)
651651

652652
/**
653653
* Find the first element matching the predicate, if one exists.
@@ -680,7 +680,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
680680
*/
681681

682682
def findM[G[_], A](fa: F[A])(p: A => G[Boolean])(implicit G: Monad[G]): G[Option[A]] =
683-
G.tailRecM(Foldable.Source.fromFoldable(fa)(self))(_.uncons match {
683+
G.tailRecM(Foldable.Source.fromFoldable(fa)(using self))(_.uncons match {
684684
case Some((a, src)) => G.map(p(a))(if (_) Right(Some(a)) else Left(src.value))
685685
case None => G.pure(Right(None))
686686
})
@@ -729,7 +729,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
729729
* }}}
730730
*/
731731
def existsM[G[_], A](fa: F[A])(p: A => G[Boolean])(implicit G: Monad[G]): G[Boolean] =
732-
G.tailRecM(Foldable.Source.fromFoldable(fa)(self)) { src =>
732+
G.tailRecM(Foldable.Source.fromFoldable(fa)(using self)) { src =>
733733
src.uncons match {
734734
case Some((a, src)) => G.map(p(a))(bb => if (bb) Right(true) else Left(src.value))
735735
case None => G.pure(Right(false))
@@ -764,7 +764,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
764764
* }}}
765765
*/
766766
def forallM[G[_], A](fa: F[A])(p: A => G[Boolean])(implicit G: Monad[G]): G[Boolean] =
767-
G.tailRecM(Foldable.Source.fromFoldable(fa)(self)) { src =>
767+
G.tailRecM(Foldable.Source.fromFoldable(fa)(using self)) { src =>
768768
src.uncons match {
769769
case Some((a, src)) => G.map(p(a))(bb => if (!bb) Right(false) else Left(src.value))
770770
case None => G.pure(Right(true))
@@ -853,7 +853,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
853853
* }}}
854854
*/
855855
def intercalate[A](fa: F[A], a: A)(implicit A: Monoid[A]): A =
856-
combineAllOption(fa)(A.intercalate(a)) match {
856+
combineAllOption(fa)(using A.intercalate(a)) match {
857857
case None => A.empty
858858
case Some(a) => a
859859
}
@@ -958,7 +958,7 @@ trait Foldable[F[_]] extends UnorderedFoldable[F] with FoldableNFunctions[F] { s
958958
fa: F[A]
959959
)(f: A => G[Either[B, C]])(implicit A: Alternative[F], M: Monad[G]): G[(F[B], F[C])] = {
960960
import cats.instances.either.*
961-
partitionBifoldM[G, Either, A, B, C](fa)(f)(A, M, Bifoldable[Either])
961+
partitionBifoldM[G, Either, A, B, C](fa)(f)(using A, M, Bifoldable[Either])
962962
}
963963
}
964964

@@ -1041,38 +1041,38 @@ object Foldable {
10411041
typeClassInstance.reduceRightToOption[A, B](self)(f)(g)
10421042
def reduceLeftOption(f: (A, A) => A): Option[A] = typeClassInstance.reduceLeftOption[A](self)(f)
10431043
def reduceRightOption(f: (A, Eval[A]) => Eval[A]): Eval[Option[A]] = typeClassInstance.reduceRightOption[A](self)(f)
1044-
def minimumOption(implicit A: Order[A]): Option[A] = typeClassInstance.minimumOption[A](self)(A)
1045-
def maximumOption(implicit A: Order[A]): Option[A] = typeClassInstance.maximumOption[A](self)(A)
1044+
def minimumOption(implicit A: Order[A]): Option[A] = typeClassInstance.minimumOption[A](self)(using A)
1045+
def maximumOption(implicit A: Order[A]): Option[A] = typeClassInstance.maximumOption[A](self)(using A)
10461046
def minimumByOption[B](f: A => B)(implicit ev$1: Order[B]): Option[A] =
10471047
typeClassInstance.minimumByOption[A, B](self)(f)
10481048
def maximumByOption[B](f: A => B)(implicit ev$1: Order[B]): Option[A] =
10491049
typeClassInstance.maximumByOption[A, B](self)(f)
1050-
def minimumList(implicit A: Order[A]): List[A] = typeClassInstance.minimumList[A](self)(A)
1051-
def maximumList(implicit A: Order[A]): List[A] = typeClassInstance.maximumList[A](self)(A)
1050+
def minimumList(implicit A: Order[A]): List[A] = typeClassInstance.minimumList[A](self)(using A)
1051+
def maximumList(implicit A: Order[A]): List[A] = typeClassInstance.maximumList[A](self)(using A)
10521052
def minimumByList[B](f: A => B)(implicit ev$1: Order[B]): List[A] = typeClassInstance.minimumByList[A, B](self)(f)
10531053
def maximumByList[B](f: A => B)(implicit ev$1: Order[B]): List[A] = typeClassInstance.maximumByList[A, B](self)(f)
10541054
def get(idx: Long): Option[A] = typeClassInstance.get[A](self)(idx)
10551055
def collectFirst[B](pf: PartialFunction[A, B]): Option[B] = typeClassInstance.collectFirst[A, B](self)(pf)
10561056
def collectFirstSome[B](f: A => Option[B]): Option[B] = typeClassInstance.collectFirstSome[A, B](self)(f)
10571057
def collectFoldSome[B](f: A => Option[B])(implicit B: Monoid[B]): B =
1058-
typeClassInstance.collectFoldSome[A, B](self)(f)(B)
1059-
def fold(implicit A: Monoid[A]): A = typeClassInstance.fold[A](self)(A)
1058+
typeClassInstance.collectFoldSome[A, B](self)(f)(using B)
1059+
def fold(implicit A: Monoid[A]): A = typeClassInstance.fold[A](self)(using A)
10601060
def sumAll(implicit A: Numeric[A]): A = typeClassInstance.sumAll[A](self)
10611061
def productAll(implicit A: Numeric[A]): A = typeClassInstance.productAll[A](self)
10621062
def combineAll(implicit ev$1: Monoid[A]): A = typeClassInstance.combineAll[A](self)
1063-
def combineAllOption(implicit ev: Semigroup[A]): Option[A] = typeClassInstance.combineAllOption[A](self)(ev)
1063+
def combineAllOption(implicit ev: Semigroup[A]): Option[A] = typeClassInstance.combineAllOption[A](self)(using ev)
10641064
def toIterable: Iterable[A] = typeClassInstance.toIterable[A](self)
1065-
def foldMap[B](f: A => B)(implicit B: Monoid[B]): B = typeClassInstance.foldMap[A, B](self)(f)(B)
1065+
def foldMap[B](f: A => B)(implicit B: Monoid[B]): B = typeClassInstance.foldMap[A, B](self)(f)(using B)
10661066
def foldM[G[_], B](z: B)(f: (B, A) => G[B])(implicit G: Monad[G]): G[B] =
1067-
typeClassInstance.foldM[G, A, B](self, z)(f)(G)
1067+
typeClassInstance.foldM[G, A, B](self, z)(f)(using G)
10681068
final def foldLeftM[G[_], B](z: B)(f: (B, A) => G[B])(implicit G: Monad[G]): G[B] =
1069-
typeClassInstance.foldLeftM[G, A, B](self, z)(f)(G)
1069+
typeClassInstance.foldLeftM[G, A, B](self, z)(f)(using G)
10701070
def foldMapM[G[_], B](f: A => G[B])(implicit G: Monad[G], B: Monoid[B]): G[B] =
1071-
typeClassInstance.foldMapM[G, A, B](self)(f)(G, B)
1071+
typeClassInstance.foldMapM[G, A, B](self)(f)(using G, B)
10721072
def foldMapA[G[_], B](f: A => G[B])(implicit G: Applicative[G], B: Monoid[B]): G[B] =
1073-
typeClassInstance.foldMapA[G, A, B](self)(f)(G, B)
1073+
typeClassInstance.foldMapA[G, A, B](self)(f)(using G, B)
10741074
def traverseVoid[G[_], B](f: A => G[B])(implicit G: Applicative[G]): G[Unit] =
1075-
typeClassInstance.traverseVoid[G, A, B](self)(f)(G)
1075+
typeClassInstance.traverseVoid[G, A, B](self)(f)(using G)
10761076
def traverse_[G[_], B](f: A => G[B])(implicit G: Applicative[G]): G[Unit] =
10771077
traverseVoid[G, B](f)
10781078
// TODO: looks like these two methods below duplicate the same named methods from `NestedFoldableOps`.
@@ -1083,19 +1083,19 @@ object Foldable {
10831083
def sequence_[G[_], B](implicit ev$1: A <:< G[B], ev$2: Applicative[G]): G[Unit] =
10841084
sequenceVoid[G, B]
10851085
def foldK[G[_], B](implicit ev$1: A <:< G[B], G: MonoidK[G]): G[B] =
1086-
typeClassInstance.foldK[G, B](self.asInstanceOf[F[G[B]]])(G)
1086+
typeClassInstance.foldK[G, B](self.asInstanceOf[F[G[B]]])(using G)
10871087
def find(f: A => Boolean): Option[A] = typeClassInstance.find[A](self)(f)
10881088
def existsM[G[_]](p: A => G[Boolean])(implicit G: Monad[G]): G[Boolean] =
1089-
typeClassInstance.existsM[G, A](self)(p)(G)
1089+
typeClassInstance.existsM[G, A](self)(p)(using G)
10901090
def forallM[G[_]](p: A => G[Boolean])(implicit G: Monad[G]): G[Boolean] =
1091-
typeClassInstance.forallM[G, A](self)(p)(G)
1091+
typeClassInstance.forallM[G, A](self)(p)(using G)
10921092
def toList: List[A] = typeClassInstance.toList[A](self)
10931093
def partitionEither[B, C](f: A => Either[B, C])(implicit A: Alternative[F]): (F[B], F[C]) =
1094-
typeClassInstance.partitionEither[A, B, C](self)(f)(A)
1094+
typeClassInstance.partitionEither[A, B, C](self)(f)(using A)
10951095
def filter_(p: A => Boolean): List[A] = typeClassInstance.filter_[A](self)(p)
10961096
def takeWhile_(p: A => Boolean): List[A] = typeClassInstance.takeWhile_[A](self)(p)
10971097
def dropWhile_(p: A => Boolean): List[A] = typeClassInstance.dropWhile_[A](self)(p)
1098-
def intercalate(a: A)(implicit A: Monoid[A]): A = typeClassInstance.intercalate[A](self, a)(A)
1098+
def intercalate(a: A)(implicit A: Monoid[A]): A = typeClassInstance.intercalate[A](self, a)(using A)
10991099
}
11001100
trait AllOps[F[_], A] extends Ops[F, A] with UnorderedFoldable.AllOps[F, A] {
11011101
type TypeClassType <: Foldable[F]

‎core/src/main/scala/cats/Invariant.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ object Invariant extends ScalaVersionSpecificInvariantInstances with InvariantIn
166166
implicit def catsInstancesForFuture(implicit
167167
ec: ExecutionContext
168168
): MonadThrow[Future] & CoflatMap[Future] =
169-
cats.instances.future.catsStdInstancesForFuture(ec)
169+
cats.instances.future.catsStdInstancesForFuture(using ec)
170170

171171
implicit def catsContravariantMonoidalForOrder: ContravariantMonoidal[Order] =
172172
cats.instances.order.catsContravariantMonoidalForOrder

0 commit comments

Comments
 (0)