@@ -18,42 +18,43 @@ trait Apply[F[_]] extends Functor[F] with Semigroupal[F] with ApplyArityFunction
1818 def ap [A , B ](ff : F [A => B ])(fa : F [A ]): F [B ]
1919
2020 /** Compose two actions, discarding any value produced by the first. */
21- def apR [A , B ](fa : F [A ])(fb : F [B ]): F [B ] =
21+ def productR [A , B ](fa : F [A ])(fb : F [B ]): F [B ] =
2222 map2(fa, fb)((_, b) => b)
2323
2424 /** Compose two actions, discarding any value produced by the second. */
25- def apL [A , B ](fa : F [A ])(fb : F [B ]): F [A ] =
25+ def productL [A , B ](fa : F [A ])(fb : F [B ]): F [A ] =
2626 map2(fa, fb)((a, _) => a)
2727
2828 override def product [A , B ](fa : F [A ], fb : F [B ]): F [(A , B )] =
29- ap(map(fa)(a => ( b : B ) => (a, b)))(fb )
29+ map2(fa, fb)((_, _) )
3030
3131 /** Alias for [[ap ]]. */
3232 @ inline final def <*> [A , B ](ff : F [A => B ])(fa : F [A ]): F [B ] =
3333 ap(ff)(fa)
3434
35- /** Alias for [[apR ]]. */
35+ /** Alias for [[productR ]]. */
3636 @ inline final def *> [A , B ](fa : F [A ])(fb : F [B ]): F [B ] =
37- apR (fa)(fb)
37+ productR (fa)(fb)
3838
39- /** Alias for [[apL ]]. */
39+ /** Alias for [[productL ]]. */
4040 @ inline final def <* [A , B ](fa : F [A ])(fb : F [B ]): F [A ] =
41- apL (fa)(fb)
41+ productL (fa)(fb)
4242
43- /** Alias for [[apR ]]. */
44- @ deprecated(" Use *> or apR instead." , " 1.0.0" )
43+ /** Alias for [[productR ]]. */
44+ @ deprecated(" Use *> or apR instead." , " 1.0.0-RC2 " )
4545 @ noop @ inline final def followedBy [A , B ](fa : F [A ])(fb : F [B ]): F [B ] =
46- apR (fa)(fb)
46+ productR (fa)(fb)
4747
48- /** Alias for [[apL ]]. */
49- @ deprecated(" Use <* or apL instead." , " 1.0.0" )
48+ /** Alias for [[productL ]]. */
49+ @ deprecated(" Use <* or apL instead." , " 1.0.0-RC2 " )
5050 @ noop @ inline final def forEffect [A , B ](fa : F [A ])(fb : F [B ]): F [A ] =
51- apL (fa)(fb)
51+ productL (fa)(fb)
5252
5353 /**
5454 * ap2 is a binary version of ap, defined in terms of ap.
5555 */
5656 def ap2 [A , B , Z ](ff : F [(A , B ) => Z ])(fa : F [A ], fb : F [B ]): F [Z ] =
57+
5758 map(product(fa, product(fb, ff))) { case (a, (b, f)) => f(a, b) }
5859
5960 /**
@@ -62,7 +63,7 @@ trait Apply[F[_]] extends Functor[F] with Semigroupal[F] with ApplyArityFunction
6263 * map2 can be seen as a binary version of [[cats.Functor ]]#map.
6364 */
6465 def map2 [A , B , Z ](fa : F [A ], fb : F [B ])(f : (A , B ) => Z ): F [Z ] =
65- map(product(fa, fb)) { case (a, b ) => f(a, b) }
66+ ap( map(fa)(a => ( b : B ) => f(a, b)))(fb)
6667
6768 /**
6869 * Similar to [[map2 ]] but uses [[Eval ]] to allow for laziness in the `F[B]`
0 commit comments