Open turion opened 5 years ago
Would you suggest to drop :order
and :eq
then?
Yes. If order
and eq
are both lawful, then the information contained in compare
is the same.
The only case for keeping order
and eq
around I can think of is non-lawful ones, e.g. when eq(x,y)
does not imply order(x, y) && order(y, x)
. But I'd argue that such situations are confusing anyways and should be worked around in a different way (e.g. using #10 or #8).
I think that some parts of the code could be simplified by passing a
compare
function with@spec compare(data, data) :: :lt | :eq | :gt when data: var
instead oforder
andeq
.