Documentation ¶
Index ¶
- func AllMatch[Data any](datas []Data, test func(Data) bool) bool
- func AllMatchPro[Data any, Datas ~[]Data](datas Datas, test func(int, Data, Datas) bool) bool
- func AnyMatch[Data any](datas []Data, test func(Data) bool) bool
- func AnyMatchPro[Data any, Datas ~[]Data](datas Datas, test func(int, Data, Datas) bool) bool
- func BatchDeleteMap[Key comparable, Keys ~[]Key, Value any, Map ~map[Key]Value](m Map, keys Keys) Map
- func BatchDeleteMapFromAnother[Key comparable, Value any, Map ~map[Key]Value](m Map, keys Map) Map
- func CacheMapValue[Key comparable, Value any, Map ~map[Key]Value](m Map, key Key, value Value) Value
- func CacheMapValueWithInitializer[Key comparable, Value any, Map ~map[Key]Value](m Map, key Key, initializer func() Value) Value
- func Compare[Data constraints.Ordered](as []Data, bs []Data) int
- func ConcatMap[Key comparable, Value any, Map ~map[Key]Value](m1, m2 Map) Map
- func ConcatMapInplace[Key comparable, Value any, Map ~map[Key]Value](m1, m2 Map) Map
- func ConcatSlices[Data any, Slice ~[]Data](slices ...Slice) Slice
- func ConcatSlicesTo[Data any, Slice ~[]Data](slice Slice, slices ...Slice) Slice
- func Dup[Data any, Ptr ~*Data](ptr Ptr) Ptr
- func DupMap[Key comparable, Value any, Map ~map[Key]Value](m Map) Map
- func DupSlice[Data any, Slice ~[]Data](slice Slice) Slice
- func EqualBySet[Data comparable](as []Data, bs []Data) bool
- func EqualBySort[Data constraints.Ordered](as []Data, bs []Data) bool
- func FillSliceToCap[Data any, Datas ~[]Data](datas Datas, g func(int) Data) Datas
- func Filter[Data any, Datas ~[]Data](datas Datas, filter func(Data) bool) Datas
- func FilterPro[Data any, Datas ~[]Data](datas Datas, filter func(int, Data, Datas) bool) Datas
- func Find[Data any](datas []Data, test func(Data) bool) (Data, bool)
- func ForEach[Data any](datas []Data, handler func(data Data))
- func ForEachPro[Data any, Datas ~[]Data](datas Datas, handler func(i int, data Data, datas Datas))
- func GetSliceElemPointers[Data any, Datas ~[]Data](datas Datas) []*Data
- func IndexOf[Data comparable](datas []Data, target Data) int
- func InstancesToPointers[Data any, Instances ~[]Data](instances Instances) []*Data
- func Map[Data any, Datas ~[]Data, Result any](datas Datas, mapper func(Data) Result) []Result
- func MapAndConcat[Data any, Datas ~[]Data, Result any, Results ~[]Result](datas Datas, mapper func(Data) Results) Results
- func MapArgs[Data any, Result any](mapper func(Data) Result, args ...Data) []Result
- func MapKeys[Key comparable, Value any, Map ~map[Key]Value](m Map) []Key
- func MapPro[Data any, Datas ~[]Data, Result any](datas Datas, mapper func(int, Data, Datas) Result) []Result
- func MapProArgs[Data any, Datas ~[]Data, Result any](mapper func(int, Data, Datas) Result, datas ...Data) []Result
- func MapValues[Key comparable, Value any, Map ~map[Key]Value](m Map) []Value
- func MapValuesByKeys[Key comparable, Value any, Map ~map[Key]Value](m Map, keys ...Key) []Value
- func MappingByKey[Data any, Datas ~[]Data, Key comparable](datas Datas, key func(Data) Key) map[Key]Data
- func MappingByKeyPro[Data any, Datas ~[]Data, Key comparable](datas Datas, key func(int, Data, Datas) Key) map[Key]Data
- func MappingByKeys[Data any, Datas ~[]Data, Key comparable, Keys ~[]Key](datas Datas, keys func(Data) Keys) map[Key]Data
- func PopMap[Key comparable, Value any, Map ~map[Key]Value](m Map, key Key) (value Value, ok bool)
- func Purge[Data any, Datas ~[]Data](datas Datas, filter func(Data) bool) Datas
- func PurgeValue[Data comparable, Datas ~[]Data](datas Datas, value Data) Datas
- func PurgeZero[Data comparable, Datas ~[]Data](datas Datas) Datas
- func ReadChan[Data any](c chan Data, n int) []Data
- func ReadChanAll[Data any, Datas ~[]Data](c chan Data) (datas Datas)
- func Reduce[Data any, Datas ~[]Data, Result any](datas Datas, reducer func(Data, Result) Result, initial Result) (result Result)
- func ReducePro[Data any, Datas ~[]Data, Result any](datas Datas, reducer func(int, Data, Datas, Result) Result, initial Result) (result Result)
- func SliceEqual[Datas ~[]Data, Data comparable](as Datas, bs Datas) bool
- func SliceMappingByKey[Data any, Datas ~[]Data, Key comparable](datas Datas, key func(Data) Key) map[Key]Datas
- func SliceMappingByKeys[Data any, Datas ~[]Data, Key comparable, Keys ~[]Key](datas Datas, keys func(Data) Keys) map[Key]Datas
- func Sort[Data any, Datas ~[]Data](datas Datas, less func(a, b Data) bool) Datas
- func SortFast[Data constraints.Ordered, Datas ~[]Data](datas Datas) Datas
- func SortUniqueFast[Data constraints.Ordered, Datas ~[]Data](datas Datas) Datas
- func Unique[Data comparable, Datas ~[]Data](datas Datas, equal func(Data, Data) bool) Datas
- func UniqueByKeySet[Datas ~[]Data, Data any, Key comparable](datas Datas, key func(Data) Key) Datas
- func UniqueBySet[Data comparable, Datas ~[]Data](datas Datas) Datas
- func UniqueSorteds[Data comparable, Datas ~[]Data](datas Datas) Datas
- type ComparableSlice
- func (slice ComparableSlice[Data]) AllMatch(f func(Data) bool) bool
- func (slice ComparableSlice[Data]) AnyMatch(f func(Data) bool) bool
- func (slice ComparableSlice[Data]) Contain(data Data) bool
- func (slice ComparableSlice[Data]) ContainAll(datas ...Data) bool
- func (slice ComparableSlice[Data]) ContainAny(datas ...Data) bool
- func (slice ComparableSlice[Data]) Dup() ComparableSlice[Data]
- func (slice ComparableSlice[Data]) Filter(f func(Data) bool) ComparableSlice[Data]
- func (slice ComparableSlice[Data]) ForEachPro(f func(int, Data, ComparableSlice[Data]))
- func (slice ComparableSlice[Data]) Map(f func(Data) Data) Slice[Data]
- func (slice ComparableSlice[Data]) Native() []Data
- func (slice ComparableSlice[Data]) NotNilSlice() ComparableSlice[Data]
- type Set
- func (set Set[Data]) Add(data Data) Set[Data]
- func (set Set[Data]) AddX(datas ...Data) Set[Data]
- func (set Set[Data]) Contain(data Data) bool
- func (set Set[Data]) Difference(other Set[Data]) Set[Data]
- func (set Set[Data]) Dup() Set[Data]
- func (set Set[Data]) Empty() bool
- func (set Set[Data]) Equal(other Set[Data]) bool
- func (set Set[Data]) FirstAppear(datas ...Data) (result Data)
- func (set Set[Data]) Intersection(other Set[Data]) Set[Data]
- func (set Set[Data]) Len() int
- func (set Set[Data]) Merge(other Set[Data]) Set[Data]
- func (set Set[Data]) Pop(data Data) Set[Data]
- func (set Set[Data]) Purge(other Set[Data]) Set[Data]
- func (set Set[Data]) Push(data Data) Set[Data]
- func (set Set[Data]) PushX(datas ...Data) Set[Data]
- func (set Set[Data]) Slice() Slice[Data]
- func (set Set[Data]) SymmetricDifference(other Set[Data]) Set[Data]
- func (set Set[Data]) Union(other Set[Data]) Set[Data]
- type Slice
- func (slice Slice[Data]) AllMatch(f func(Data) bool) bool
- func (slice Slice[Data]) AnyMatch(f func(Data) bool) bool
- func (slice Slice[Data]) Dup() Slice[Data]
- func (slice Slice[Data]) Filter(f func(Data) bool) Slice[Data]
- func (slice Slice[Data]) FilterPro(f func(int, Data, Slice[Data]) bool) Slice[Data]
- func (slice Slice[Data]) ForEach(f func(Data))
- func (slice Slice[Data]) ForEachPro(f func(int, Data, Slice[Data]))
- func (slice Slice[Data]) Map(f func(Data) Data) Slice[Data]
- func (slice Slice[Data]) MapPro(f func(int, Data, Slice[Data]) Data) Slice[Data]
- func (slice Slice[Data]) Native() []Data
- func (slice Slice[Data]) NotNilSlice() Slice[Data]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllMatchPro ¶ added in v1.0.3
func AnyMatchPro ¶ added in v1.0.3
func BatchDeleteMap ¶
func BatchDeleteMap[Key comparable, Keys ~[]Key, Value any, Map ~map[Key]Value](m Map, keys Keys) Map
func BatchDeleteMapFromAnother ¶
func BatchDeleteMapFromAnother[Key comparable, Value any, Map ~map[Key]Value](m Map, keys Map) Map
func CacheMapValue ¶ added in v1.0.8
func CacheMapValue[Key comparable, Value any, Map ~map[Key]Value](m Map, key Key, value Value) Value
func CacheMapValueWithInitializer ¶ added in v1.0.8
func CacheMapValueWithInitializer[Key comparable, Value any, Map ~map[Key]Value](m Map, key Key, initializer func() Value) Value
func Compare ¶ added in v1.0.8
func Compare[Data constraints.Ordered](as []Data, bs []Data) int
func ConcatMap ¶
func ConcatMap[Key comparable, Value any, Map ~map[Key]Value](m1, m2 Map) Map
func ConcatMapInplace ¶
func ConcatMapInplace[Key comparable, Value any, Map ~map[Key]Value](m1, m2 Map) Map
func ConcatSlices ¶
func ConcatSlices[Data any, Slice ~[]Data](slices ...Slice) Slice
func ConcatSlicesTo ¶
func ConcatSlicesTo[Data any, Slice ~[]Data](slice Slice, slices ...Slice) Slice
func DupMap ¶
func DupMap[Key comparable, Value any, Map ~map[Key]Value](m Map) Map
func EqualBySet ¶ added in v1.0.8
func EqualBySet[Data comparable](as []Data, bs []Data) bool
func EqualBySort ¶ added in v1.0.8
func EqualBySort[Data constraints.Ordered](as []Data, bs []Data) bool
func FillSliceToCap ¶ added in v1.0.8
func ForEachPro ¶ added in v1.0.3
func GetSliceElemPointers ¶
func GetSliceElemPointers[Data any, Datas ~[]Data](datas Datas) []*Data
func IndexOf ¶
func IndexOf[Data comparable](datas []Data, target Data) int
func InstancesToPointers ¶
func InstancesToPointers[Data any, Instances ~[]Data](instances Instances) []*Data
func MapAndConcat ¶
func MapKeys ¶
func MapKeys[Key comparable, Value any, Map ~map[Key]Value](m Map) []Key
func MapProArgs ¶ added in v1.0.3
func MapValues ¶ added in v1.0.6
func MapValues[Key comparable, Value any, Map ~map[Key]Value](m Map) []Value
func MapValuesByKeys ¶ added in v1.0.6
func MapValuesByKeys[Key comparable, Value any, Map ~map[Key]Value](m Map, keys ...Key) []Value
func MappingByKey ¶
func MappingByKey[Data any, Datas ~[]Data, Key comparable](datas Datas, key func(Data) Key) map[Key]Data
func MappingByKeyPro ¶ added in v1.0.3
func MappingByKeyPro[Data any, Datas ~[]Data, Key comparable](datas Datas, key func(int, Data, Datas) Key) map[Key]Data
func MappingByKeys ¶
func MappingByKeys[Data any, Datas ~[]Data, Key comparable, Keys ~[]Key](datas Datas, keys func(Data) Keys) map[Key]Data
func PopMap ¶
func PopMap[Key comparable, Value any, Map ~map[Key]Value](m Map, key Key) (value Value, ok bool)
func PurgeValue ¶
func PurgeValue[Data comparable, Datas ~[]Data](datas Datas, value Data) Datas
func PurgeZero ¶
func PurgeZero[Data comparable, Datas ~[]Data](datas Datas) Datas
func ReadChanAll ¶ added in v1.0.8
func ReadChanAll[Data any, Datas ~[]Data](c chan Data) (datas Datas)
func SliceEqual ¶ added in v1.0.11
func SliceEqual[Datas ~[]Data, Data comparable](as Datas, bs Datas) bool
func SliceMappingByKey ¶
func SliceMappingByKey[Data any, Datas ~[]Data, Key comparable](datas Datas, key func(Data) Key) map[Key]Datas
func SliceMappingByKeys ¶
func SliceMappingByKeys[Data any, Datas ~[]Data, Key comparable, Keys ~[]Key](datas Datas, keys func(Data) Keys) map[Key]Datas
func SortFast ¶
func SortFast[Data constraints.Ordered, Datas ~[]Data](datas Datas) Datas
func SortUniqueFast ¶
func SortUniqueFast[Data constraints.Ordered, Datas ~[]Data](datas Datas) Datas
func Unique ¶
func Unique[Data comparable, Datas ~[]Data](datas Datas, equal func(Data, Data) bool) Datas
func UniqueByKeySet ¶ added in v1.0.11
func UniqueByKeySet[Datas ~[]Data, Data any, Key comparable](datas Datas, key func(Data) Key) Datas
func UniqueBySet ¶
func UniqueBySet[Data comparable, Datas ~[]Data](datas Datas) Datas
func UniqueSorteds ¶ added in v1.0.11
func UniqueSorteds[Data comparable, Datas ~[]Data](datas Datas) Datas
Types ¶
type ComparableSlice ¶ added in v1.0.8
type ComparableSlice[Data comparable] []Data
func NewComparableSlice ¶ added in v1.0.8
func NewComparableSlice[Data comparable](datas ...Data) ComparableSlice[Data]
func (ComparableSlice[Data]) AllMatch ¶ added in v1.0.8
func (slice ComparableSlice[Data]) AllMatch(f func(Data) bool) bool
func (ComparableSlice[Data]) AnyMatch ¶ added in v1.0.8
func (slice ComparableSlice[Data]) AnyMatch(f func(Data) bool) bool
func (ComparableSlice[Data]) Contain ¶ added in v1.0.11
func (slice ComparableSlice[Data]) Contain(data Data) bool
func (ComparableSlice[Data]) ContainAll ¶ added in v1.0.11
func (slice ComparableSlice[Data]) ContainAll(datas ...Data) bool
func (ComparableSlice[Data]) ContainAny ¶ added in v1.0.11
func (slice ComparableSlice[Data]) ContainAny(datas ...Data) bool
func (ComparableSlice[Data]) Dup ¶ added in v1.0.8
func (slice ComparableSlice[Data]) Dup() ComparableSlice[Data]
func (ComparableSlice[Data]) Filter ¶ added in v1.0.8
func (slice ComparableSlice[Data]) Filter(f func(Data) bool) ComparableSlice[Data]
func (ComparableSlice[Data]) ForEachPro ¶ added in v1.0.8
func (slice ComparableSlice[Data]) ForEachPro(f func(int, Data, ComparableSlice[Data]))
func (ComparableSlice[Data]) Map ¶ added in v1.0.8
func (slice ComparableSlice[Data]) Map(f func(Data) Data) Slice[Data]
func (ComparableSlice[Data]) Native ¶ added in v1.0.8
func (slice ComparableSlice[Data]) Native() []Data
func (ComparableSlice[Data]) NotNilSlice ¶ added in v1.0.8
func (slice ComparableSlice[Data]) NotNilSlice() ComparableSlice[Data]
type Set ¶
type Set[Data comparable] map[Data]struct{}
func NewEmptySet ¶
func NewEmptySet[Data comparable]() Set[Data]
func NewSet ¶
func NewSet[Data comparable](datas ...Data) Set[Data]
func (Set[Data]) Difference ¶
func (Set[Data]) FirstAppear ¶ added in v1.0.8
func (set Set[Data]) FirstAppear(datas ...Data) (result Data)
func (Set[Data]) Intersection ¶
func (Set[Data]) SymmetricDifference ¶
type Slice ¶ added in v1.0.8
type Slice[Data any] []Data
func (Slice[Data]) ForEachPro ¶ added in v1.0.8
func (Slice[Data]) NotNilSlice ¶ added in v1.0.8
Click to show internal directories.
Click to hide internal directories.