Deprecate foreach in API
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 5.5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 5
Description
On principle, Cats has not provided foreach methods for most of its datatypes as this method implies side-effects. To be consistent, the following methods should be marked deprecated, documenting the suggested workarounds of either:
- using IO.traverse or
- using alleycats
foreachadditions to Foldable
core/src/main/scala/cats/data/Ior.scala
84: final def foreach(f: B => Unit): Unit = {
core/src/main/scala/cats/data/Validated.scala
31: def foreach(f: A => Unit): Unit = this match {
core/src/main/scala/cats/syntax/either.scala
38: def foreach(f: B => Unit): Unit = eab match {
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 the listed foreach methods in core/src/main/scala/cats/data/Ior.scala, core/src/main/scala/cats/data/Validated.scala, and core/src/main/scala/cats/syntax/either.scala. Review the surrounding API and deprecation conventions, then verify that each method documents IO.traverse or alleycats foreach as the suggested workaround and that the affected Scala tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100