[erlang-questions] Sets from list then to list?

Per Gustafsson <>
Mon Apr 7 12:36:19 CEST 2008


Alexander Lamb wrote:
> Well, spoke to fast. usort/1 works fine, but when I provide my own  
> function, it doesn't remove the duplicates.
> It looks like this is because my sort function can only return true or  
> false. What should it return to usort/2 removes correctly duplicates.
> 
> Thanks,
> 
> Alex
> 

It seems (from the source code) that it should be a function F which 
returns true for both F(X,Y) and F(Y,X) if X is equal to Y.

Per



More information about the erlang-questions mailing list