mirror of
https://github.com/IBM/fp-go.git
synced 2025-08-10 22:31:32 +02:00
fix: add a uniq method to arrays
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
@@ -19,13 +19,13 @@ import (
|
||||
G "github.com/IBM/fp-go/iterator/stateless/generic"
|
||||
)
|
||||
|
||||
// StrictUniq converts an [Iterator] or arbitrary items into an [Iterator] or unique items
|
||||
// StrictUniq converts an [Iterator] of arbitrary items into an [Iterator] or unique items
|
||||
// where uniqueness is determined by the built-in uniqueness constraint
|
||||
func StrictUniq[A comparable](as Iterator[A]) Iterator[A] {
|
||||
return G.StrictUniq[Iterator[A]](as)
|
||||
}
|
||||
|
||||
// Uniq converts an [Iterator] or arbitrary items into an [Iterator] or unique items
|
||||
// Uniq converts an [Iterator] of arbitrary items into an [Iterator] or unique items
|
||||
// where uniqueness is determined based on a key extractor function
|
||||
func Uniq[A any, K comparable](f func(A) K) func(as Iterator[A]) Iterator[A] {
|
||||
return G.Uniq[Iterator[A], K](f)
|
||||
|
Reference in New Issue
Block a user