Fix botched unique implementation

This commit is contained in:
Danila Fedorin 2019-09-09 01:56:38 -07:00
parent 911e46c4c3
commit ccfd2fe76b

View File

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