Fix botched unique implementation
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user