elm-diff
elm-diff copied to clipboard
Add diffEq which uses custom equality function for comparisons
Would you accept PR for function
diffEq : (a -> a -> Bool) -> List a -> List a -> List (Change a)
which is just like diff except it uses given equality function instead of == to compare items.
I can make PR, but I just wanted to first ask whether such a function would be OK for this package.
I've just realized that this function needs to return in NoChange case both of the "equal" values. So returned item needs to be something like
type Change a
= Added a
| Removed a
| NoChange a a
I'm not sure what is the best approach here. Should this be implemented in separate module, e.g. DiffEq, so that function name, type name and variant names can remain the same as in Diff? Or should all of these be given different names?