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