-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Deprecate shadowed sequenceVoid/sequence_/foldK in Foldable.Ops #4825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1073,13 +1073,22 @@ object Foldable { | |
| typeClassInstance.traverseVoid[G, A, B](self)(f)(G) | ||
| def traverse_[G[_], B](f: A => G[B])(implicit G: Applicative[G]): G[Unit] = | ||
| traverseVoid[G, B](f) | ||
| // TODO: looks like these two methods below duplicate the same named methods from `NestedFoldableOps`. | ||
| // Moreover, the other two methods take precedence, thereby these two are not in use whatsoever. | ||
| // Perhaps it makes sense to deprecate one pair of them either here or there. | ||
| @deprecated( | ||
| "Use catsSyntaxNestedFoldable (via cats.syntax.all._) to call sequenceVoid on F[G[A]]", | ||
| "2.13.0" | ||
| ) | ||
| def sequenceVoid[G[_], B](implicit ev$1: A <:< G[B], ev$2: Applicative[G]): G[Unit] = | ||
| typeClassInstance.sequenceVoid[G, B](self.asInstanceOf[F[G[B]]]) | ||
| @deprecated( | ||
| "Use catsSyntaxNestedFoldable (via cats.syntax.all._) to call sequence_ on F[G[A]]", | ||
| "2.13.0" | ||
| ) | ||
| def sequence_[G[_], B](implicit ev$1: A <:< G[B], ev$2: Applicative[G]): G[Unit] = | ||
| sequenceVoid[G, B] | ||
|
Comment on lines
+1082
to
1087
|
||
| @deprecated( | ||
| "Use catsSyntaxNestedFoldable (via cats.syntax.all._) to call foldK on F[G[A]]", | ||
| "2.13.0" | ||
| ) | ||
| def foldK[G[_], B](implicit ev$1: A <:< G[B], G: MonoidK[G]): G[B] = | ||
| typeClassInstance.foldK[G, B](self.asInstanceOf[F[G[B]]])(G) | ||
|
Comment on lines
+1088
to
1093
|
||
| def find(f: A => Boolean): Option[A] = typeClassInstance.find[A](self)(f) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deprecation message suggests switching to
catsSyntaxNestedFoldable/cats.syntax.all._, but these deprecated methods are selected specifically when the receiver is typed asF[A]with only anA <:< G[B]evidence (i.e., not anF[G[B]]), whereNestedFoldableOpswill not apply. Consider updating the message to a replacement that compiles in that scenario (e.g., usingtraverseVoid(ev$1)/traverse_for sequencing).