Skip to content

Commit

Permalink
Merge pull request #4557 from valencik/dot-units
Browse files Browse the repository at this point in the history
Use `Applicative#unit` in `Foldable#traverse_`
  • Loading branch information
djspiewak authored Feb 3, 2024
2 parents 8842a5c + 5b57d5d commit f58181d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/Foldable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) { (_, _) =>
()
}
Expand Down

0 comments on commit f58181d

Please sign in to comment.