FoldableTests are not testing sequence_/traverse_
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 5.5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 5
Description
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 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with FoldableTests and the referenced pull request commit to see how sequence_ and traverse_ are currently exercised. Determine which laws should cover those methods, including the proposed sequence_ == foldMap(identity) relationship, then run the relevant Foldable law tests; done means the missing behavior is covered without changing semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100