setof-like with duplicates in prolog?
As you know setof/3
can order a list with duplicate removal. Is there a way to use 开发者_如何转开发setof/3
keeping duplicates? Basically is there a built-in sorting function setof-like? (meaning if I have [a,3,2,c,b]
then I'll get [2,3,a,b,c]
.
PS: don't suggest "Implement a merge sort/insertion sort/whatever". I'm looking for a built-in way.
See here, note the Distinguish argument.
精彩评论