Documentation
¶
Index ¶
- func Difference[T any, R comparable](aSlice, bSlice []T, key func(key T) R) []T
- func Intersect[T any, R comparable](aSlice, bSlice []T, key func(key T) R) []T
- func SetBy[T any, R comparable](slice []T, key func(key T) R) map[R]T
- func Sum[T any, R comparable](aSlice, bSlice []T, key func(key T) R) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Difference ¶
func Difference[T any, R comparable](aSlice, bSlice []T, key func(key T) R) []T
Difference returns set difference calclated by aSlice - bSlice expressed by slice.
func Intersect ¶
func Intersect[T any, R comparable](aSlice, bSlice []T, key func(key T) R) []T
Intersect returns intersection set expressed by slice. This function expressed by `aSlice and bSlice`.
func SetBy ¶
func SetBy[T any, R comparable](slice []T, key func(key T) R) map[R]T
SetBy returns map structured by no duplicated elements.
func Sum ¶
func Sum[T any, R comparable](aSlice, bSlice []T, key func(key T) R) []T
Sum returns set by sum. expressed by `a or b`.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.