Documentation
¶
Overview ¶
Package lo provides various utility functions.
Index ¶
- func Difference[S ~[]E, E cmp.Ordered](s1, s2 S) S
- func DifferenceFunc[S ~[]E, E any](s1, s2 S, cmp func(a, b E) int) S
- func Intersection[S ~[]E, E cmp.Ordered](s1, s2 S) S
- func IntersectionFunc[S ~[]E, E any](s1, s2 S, cmp func(a, b E) int) S
- func SymmetricDifference[S ~[]E, E cmp.Ordered](s1, s2 S) (S, S)
- func SymmetricDifferenceFunc[S ~[]E, E any](s1, s2 S, cmp func(a, b E) int) (S, S)
- func Union[S ~[]E, E cmp.Ordered](s1, s2 S) S
- func UnionFunc[S ~[]E, E any](s1, s2 S, cmp func(a, b E) int) S
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Difference ¶
Difference returns elements that are present in s1 but not present in s2. Both s1 and s2 must be sorted.
func DifferenceFunc ¶
DifferenceFunc is like Difference but uses a custom comparison function on each pair of elements.
func Intersection ¶
Intersection returns elements that are present in both s1 and s2. Both s1 and s2 must be sorted.
func IntersectionFunc ¶
IntersectionFunc is like Intersection but uses a custom comparison function on each pair of elements.
func SymmetricDifference ¶
SymmetricDifference returns slices with elements unique to slices s1 and s2. First slice will contain elements that are present in s1 but not present in s2. Second slice will contain elements that are present in s2 but not present in s1. Both s1 and s2 must be sorted.
func SymmetricDifferenceFunc ¶
SymmetricDifferenceFunc is like SymmetricDifference but uses a custom comparison function on each pair of elements.
Types ¶
This section is empty.