-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stefanos Stefanou
committed
Nov 1, 2023
1 parent
837834c
commit 4e03dd7
Showing
2 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package mycats.lib.syntax | ||
import mycats.lib.morphisms.{Functor, Semigroupal} | ||
|
||
object TupleCombineOps { | ||
|
||
implicit class Tuple2SemigroupalOps[F[_],A,B](ab:Tuple2[F[A],F[B]]){ | ||
def mapN[C](f:Tuple2[A,B]=>C)(implicit semigroupalWithFunctor:Semigroupal[F] with Functor[F]): F[C] = | ||
semigroupalWithFunctor.map[(A,B),C](semigroupalWithFunctor.product[A,B](ab._1,ab._2))(f) | ||
} | ||
|
||
} |