You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could have a law that: fa.sequence_ == fa.foldMap(identity) where we construct the natural Monoid[G[Unit]] for an Applicative.
More generally, I think we should have a practice that each instance matches an instance with only the abstract methods proxied through. This guarantees that all the other methods are only override for efficiency, not to change any semantics. If we made sure to test this way we could simplify our tests since we only need to write laws on the abstract methods, and then the additional law that we match the proxied instance.
The text was updated successfully, but these errors were encountered:
I tried quite a while ago to generate these sort of tests with scalameta, but I stopped I think when I had to deal with inheritance (for example Apply where we also need Functor#map).
see: typelevel/cats-collections@4812b86#diff-1f70710e148c78ab48fdd3687d6ecd0bR201
I had to add that to get full test coverage.
We could have a law that:
fa.sequence_ == fa.foldMap(identity)
where we construct the naturalMonoid[G[Unit]]
for anApplicative
.More generally, I think we should have a practice that each instance matches an instance with only the abstract methods proxied through. This guarantees that all the other methods are only override for efficiency, not to change any semantics. If we made sure to test this way we could simplify our tests since we only need to write laws on the abstract methods, and then the additional law that we match the proxied instance.
The text was updated successfully, but these errors were encountered: