Files
slices/types.go

15 lines
435 B
Go

package slices
type EqualityComparator[T comparable] = func(a, b T) bool
type FilterFunc[T any] = func(T) bool
type Consumer[T any] = func(T)
type IndexedConsumer[T any] = func(int, T)
type Mapper[I, O any] = func(I) O
type ErrorMapper[I, O any] = func(I) (O, error)
type MapMapper[T any, K comparable, V any] = func(T) (K, V)
type MapUnmapper[K comparable, V, T any] = func(K, V) T
type Reducer[A, T any] = func(acc A, value T) A