I want to know if a list contains any value more than once. Here's what I have.
has_dupes(List) ->
has_dupes(List, []).
has_dupes([Item|List], Seen) ->
case lists:filter(fun(Elem) -> Elem == Item end, Seen) of
[] ->
has_dupes(List, [Item|Seen]);
_ ->
true
end;
has_dupes([], _Seen) ->
false.
Is there a simpler/more concise/more idiomatic way to do this? I'm pretty new at the Erlang.