-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #908 from adelbertc/bifunctor-compose
Add Bifunctor compose, fixes #899
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
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,14 @@ | ||
package cats | ||
package tests | ||
|
||
import cats.functor.Bifunctor | ||
import cats.laws.discipline.{SerializableTests, BifunctorTests} | ||
|
||
class BifunctorTest extends CatsSuite { | ||
type Tuple2Either[A, B] = (Either[A, B], Either[A, B]) | ||
val tuple2ComposeEither: Bifunctor[Tuple2Either] = | ||
Bifunctor[Tuple2].compose[Either] | ||
|
||
checkAll("Tuple2 compose Either", BifunctorTests(tuple2ComposeEither).bifunctor[Int, Int, Int, String, String, String]) | ||
checkAll("Bifunctor[Tuple2 compose Either]", SerializableTests.serializable(tuple2ComposeEither)) | ||
} |