difflicious icon indicating copy to clipboard operation
difflicious copied to clipboard

Regarding pair matching functions for `SetDiffer`

Open spavikevik opened this issue 1 year ago • 0 comments

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.

spavikevik avatar Dec 10 '24 06:12 spavikevik