1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-11-23 22:14:53 +02:00
Files
fp-go/v2/array/uniq.go
Dr. Carsten Leue ddb9e48441 fix: initial checkin of v2
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
2025-03-01 23:07:56 +01:00

18 lines
531 B
Go

package array
import (
G "github.com/IBM/fp-go/v2/array/generic"
)
// StrictUniq converts an array of arbitrary items into an array or unique items
// where uniqueness is determined by the built-in uniqueness constraint
func StrictUniq[A comparable](as []A) []A {
return G.StrictUniq[[]A](as)
}
// Uniq converts an array of arbitrary items into an array 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 []A) []A {
return G.Uniq[[]A](f)
}