Skip to content

Conversation

@johnynek
Copy link
Contributor

I reached for tupleLeft in this PR:

typelevel/cats-collections#779

But then looked and noticed that actually it and related functions haven't been overridden in many places. This PR addresses that.

@johnynek
Copy link
Contributor Author

I couldn't find the native error. I guess is may be some issue with the native being flakey? I can't see why the changes would fail on native but not JVM.

danicheg
danicheg previously approved these changes Dec 19, 2025
Copy link
Member

@danicheg danicheg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding some tests would be nice. Anyway, LGTM

@johnynek
Copy link
Contributor Author

Adding some tests would be nice. Anyway, LGTM

I've added some tests. Ideally these would be added to FunctorLaws saying that those methods need to match the map based implementations. Doing that, however, would break compatibility of FunctorLaws because it requires more Arbitrary and Eq instances (a major weakness of our Laws).

Honestly, I wonder if the laws need some higher kinded change. Something like ArbitraryK[[A] =>> [Arbitrary[A] => Arbitrary[F[A]]] and similiar for Eq and Cogen and then maybe define case class TestType[A](arbA: Arbitrary[A], eqA: Eq[A], cogenA: Cogen[A]) and then the system defines ArbitraryK[TestType] and then we could define new laws without requiring changes to the function types and breaking compatibility. But obviously this is a major rewrite of how the laws work.

@johnynek
Copy link
Contributor Author

@danicheg how does this look? I think it is ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants