slicexp

package
v0.0.0-...-087ca59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[TSource comparable](source []*TSource, item *TSource) bool

func CountBy

func CountBy[TSource any](source []*TSource, predicate func(*TSource) bool) int

func Distinct

func Distinct[TSource comparable](source []*TSource, keySelector func(*TSource) TSource) []TSource

func DistinctBy

func DistinctBy[TSource any, TKey comparable](source []*TSource, keySelector func(*TSource) TKey) []TKey

func Filter

func Filter[TSource any](source []*TSource, predicate func(*TSource) bool) []*TSource

func First

func First[TSource any](source []TSource, predicate func(TSource) bool) (TSource, bool)

func FirstOrNil

func FirstOrNil[TSource any](source []*TSource, predicate func(*TSource) bool) *TSource

func GroupBy

func GroupBy[TSource any, TKey comparable](source []TSource, keySelector func(TSource) TKey) map[TKey][]TSource

func Map

func Map[TSource any, TResult any](source []*TSource, selector func(*TSource) TResult) []TResult

func MapMany

func MapMany[TSource any, TResult any](source []*TSource, selector func(*TSource) []TResult) []TResult

func Sum

func Sum[TSource any](source []*TSource, selector func(*TSource) int) int

func ToHashSet

func ToHashSet[TSource any, TKey comparable](source []*TSource, keySelector func(*TSource) TKey) map[TKey]struct{}

func ToMap

func ToMap[TSource any, TKey comparable](source []*TSource, keySelector func(*TSource) TKey) map[TKey]*TSource

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL