jatcwang / jatcwang/difflicious

Regarding pair matching functions for `SetDiffer`

Open
#66 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
108
Forks
13
Avg merge
13h 7m
Merged PRs (30d)
34

Description

Hi, thanks for the nice library! I have a small issue about the default SetDiffer instance which invokes the following method
https://github.com/jatcwang/difflicious/blob/f4b0c74593eeb09f8cc28cdd53eafc7d771dc36a/modules/core/src/main/scala/difflicious/differ/SeqDiffer.scala#L151-L174

The func passed in the default instance is identity, which results in pairs of matching elements paired by equality.

However, this amounts to a useless Differ instance unless one specifies a custom pairing function. I understand the utility of being able to specify a custom pairing function for an unordered collection but I'd also expect a reasonable default one that is smart enough to match elements that are similar, something akin to the example here:
https://github.com/softwaremill/diffx/issues/6#issuecomment-758517695

Or alternatively, it would be better to drop the default instance.

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 linked SetDiffer default instance in modules/core/src/main/scala/difflicious/differ/SeqDiffer.scala at lines 151–174. Compare the current identity-based pairing with the linked diffx example, then determine whether the intended resolution is a smarter default pairing function or removal of the default instance. Done means the project has a decided behavior and corresponding implementation coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
testing
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.