Skip to content

Commit

Permalink
Remove dependency on ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Emil Hotkowski committed Aug 3, 2022
1 parent d1fa2f4 commit cdc49db
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/src/main/scala/cats/TraverseFilter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package cats

import cats.data.State
import cats.implicits.toTraverseOps

import scala.collection.immutable.{HashSet, TreeSet}

Expand Down Expand Up @@ -69,7 +68,7 @@ trait TraverseFilter[F[_]] extends FunctorFilter[F] {
* res0: List[Option[String]] = List(Some(two), None)
*/
def traverseCollect[G[_], A, B](fa: F[A])(f: PartialFunction[A, G[B]])(implicit G: Applicative[G]): G[F[B]] =
traverseFilter(fa)(a => f.lift(a).sequence)
traverseFilter(fa)(a => f.lift(a).map(G.map(_)(Option(_))).getOrElse(G.pure(None)))

/**
* {{{
Expand Down

0 comments on commit cdc49db

Please sign in to comment.