typelevel / typelevel/cats

Tight-coupling between Traverse and Foldable is a downstream burden

Open
#2,975 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
5.5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
5

Description

Hi! I have many cases where I just need a Traverse instance for my data types (very common in recursion-abstraction as it's required for monadic morphisms, {cata,ana,hylo,etc}M). In Cats Traverse extends Foldable which requires me to implement foldLeft and foldRight even though I have no need of those. If the folds were implemented via traverse and overriding was for specialisation/optimisation that it'd be fine but that's not the case.

Does Traverse really need to extend Foldable? Can we uncouple them?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Traverse and Foldable typeclass definitions and reviewing how their inheritance is used by existing instances. Determine the compatibility and migration implications of uncoupling them; done requires an agreed design and corresponding changes across affected instances and tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.