From 611bb48f3e015fba89d3f5a4dcf4e8eb770e01b2 Mon Sep 17 00:00:00 2001 From: Philipp Martini Date: Mon, 11 Feb 2019 13:47:02 +0100 Subject: [PATCH] Optimize productR in Apply --- core/src/main/scala/cats/Apply.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/cats/Apply.scala b/core/src/main/scala/cats/Apply.scala index 20780da9a2..a4a661c2f4 100644 --- a/core/src/main/scala/cats/Apply.scala +++ b/core/src/main/scala/cats/Apply.scala @@ -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.