typelevel / typelevel/cats

Maybe provide an escape hatch for UnorderedTraverse's commutative requirement

Open
#2,516 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

A question that comes up a LOT in the gitter room is how to traverse a Map, our standard answer is that you can't unless you import alleycats instances or use SortedMap instead.

UnorderedFoldable and UnorderedTraverse are a very principled way of dealing with this issue, but maybe there needs to be a way to relax the strict requirement of commutativity.
I'm not exactly sure how best to address this issue, the only thing I can think of right now is to allow a traverseDontCareABoutOrdering, but that's hardly optimal either. Interested to hear more thoughts.

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 reading the UnorderedFoldable and UnorderedTraverse abstractions, then review how Map, SortedMap, and alleycats instances are currently handled. The issue needs a settled design for relaxing the commutativity requirement and clear acceptance criteria for the resulting traversal API.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
tooling
Issue type
Feature
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.