Fix botched unique implementation

This commit is contained in:
Danila Fedorin 2019-09-09 01:56:38 -07:00
parent 911e46c4c3
commit ccfd2fe76b
1 changed files with 1 additions and 1 deletions

View File

@ -274,7 +274,7 @@ uniqueByTailRecursive f l s acc =
x::tail ->
if Set.member (f x) s
then uniqueByTailRecursive f tail s acc
else uniqueByTailRecursive f tail s (x::acc)
else uniqueByTailRecursive f tail (Set.insert (f x) s) (x::acc)
[] -> List.reverse acc
uniqueBy : (a -> comparable) -> List a -> List a