lq

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: 1 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 FirstOrDefault

func FirstOrDefault[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 Reduce

func Reduce[T any, R any](source []T, v R, reducer func(R, T) R) R

func Sum

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

func ToMap

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

func ToPointers

func ToPointers[T any](source []T) []*T

func ToSet

func ToSet[TSource any, TKey comparable](source []TSource, keySelector func(TSource) TKey) x.Set[TKey]

func ToSlice

func ToSlice[T any](source []*T) []T

Types

This section is empty.

Jump to

Keyboard shortcuts

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