I would like to know is it possible to use predsort/3
without losing duplicate values? If not, that how should I sort this list of terms?
Current sort function:
compareSecond(Delta, n(_, A, _), n(_, B, _)):-
compare(Delta, A, B).
Result:
predsort(compareSecond, [n(3, 1, 5), n(0, 0, 0), n(8, 0, 9)], X).
X = [n(0, 0, 0), n(3, 1, 5)].
You see, that term n(8,0,9)
is gone and that's not what I need.