Skip to content

Commit

Permalink
Merge pull request #4373 from UlisesTorrella/issue#4370
Browse files Browse the repository at this point in the history
Move `catsTraverseForSeq` to lower-priority implicit scope
  • Loading branch information
armanbilge authored Jan 15, 2023
2 parents bbfa146 + c70beec commit bd0d7b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/main/scala/cats/UnorderedFoldable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,14 @@ trait UnorderedFoldable[F[_]] extends Serializable {
unorderedFoldMap(fa)(a => if (p(a)) 1L else 0L)
}

private[cats] trait UnorderedFoldableLowPriority {
implicit def catsTraverseForSeq: Traverse[Seq] = cats.instances.seq.catsStdInstancesForSeq
}

object UnorderedFoldable
extends ScalaVersionSpecificTraverseInstances
with cats.instances.NTupleUnorderedFoldableInstances {
with cats.instances.NTupleUnorderedFoldableInstances
with UnorderedFoldableLowPriority {

private val orEvalMonoid: CommutativeMonoid[Eval[Boolean]] = new CommutativeMonoid[Eval[Boolean]] {
val empty: Eval[Boolean] = Eval.False
Expand All @@ -125,7 +130,6 @@ object UnorderedFoldable
implicit def catsNonEmptyTraverseForId: NonEmptyTraverse[Id] = catsInstancesForId
implicit def catsTraverseForOption: Traverse[Option] = cats.instances.option.catsStdInstancesForOption
implicit def catsTraverseForList: Traverse[List] = cats.instances.list.catsStdInstancesForList
implicit def catsTraverseForSeq: Traverse[Seq] = cats.instances.seq.catsStdInstancesForSeq
implicit def catsTraverseForVector: Traverse[Vector] = cats.instances.vector.catsStdInstancesForVector
implicit def catsTraverseForQueue: Traverse[Queue] = cats.instances.queue.catsStdInstancesForQueue
implicit def catsUnorderedTraverseForSet: UnorderedTraverse[Set] = cats.instances.set.catsStdInstancesForSet
Expand Down

0 comments on commit bd0d7b8

Please sign in to comment.