Skip to content

Commit

Permalink
Optimize productR in Apply (typelevel#2728)
Browse files Browse the repository at this point in the history
  • Loading branch information
maphi authored and rossabaker committed May 26, 2019
1 parent 8822980 commit b30c995
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/Apply.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ trait Apply[F[_]] extends Functor[F] with InvariantSemigroupal[F] with ApplyArit
*
*/
def productR[A, B](fa: F[A])(fb: F[B]): F[B] =
map2(fa, fb)((_, b) => b)
ap(map(fa)(_ => (b: B) => b))(fb)

/**
* Compose two actions, discarding any value produced by the second.
Expand Down

0 comments on commit b30c995

Please sign in to comment.