Documentation ¶
Index ¶
- func Abs[T Number](t T) T
- func Add[T Number](a, b T) T
- func All(inputs []bool) bool
- func Any(inputs []bool) bool
- func As[T any](v any) T
- func ByLength[T any](t T) int
- func ByNumericValue[T Number](t T) T
- func Complement[T any](predicate func(t T) bool) func(t T) bool
- func Concat[T any](slices ...[]T) (result []T)
- func Drain[T any](channel <-chan T) (slice []T)
- func Drop[T any](n int, values []T) []T
- func DropAllBut[T any](n int, values []T) []T
- func DropWhile[T any](predicate func(T) bool, values []T) (result []T)
- func Filter[T any](predicate func(t T) bool, values []T) (result []T)
- func FilterAs[T any](collection []any) []T
- func First[T any](values []T) T
- func FirstNonDefault[T comparable](values ...T) (zero T)
- func FirstOrDefault[T any](values []T) (default_ T)
- func Flatten[T any](matrix [][]T) (result []T)
- func Frequencies[T comparable](values []T) map[T]int
- func GroupBy[K comparable, V any](key func(V) K, list []V) (result [][]V)
- func IndexBy[K comparable, V any](key func(V) K, list []V) map[K]V
- func Is[T any](v any) bool
- func IsEven[T Integer](t T) bool
- func IsOdd[T Integer](t T) bool
- func KeyValueIndexBy[K comparable, V1, V2 any](kv func(V1) (K, V2), list []V1) map[K]V2
- func Last[T any](values []T) T
- func LastOrDefault[T any](values []T) (default_ T)
- func Load[T any](result chan<- T, stream []T)
- func Map[I, O any](transform func(i I) O, values []I) (result []O)
- func Map2[Ia, Ib, O any](transform func(Ia, Ib) O, a []Ia, b []Ib) (result []O)
- func MapAsAny[T any](items []T) (result []any)
- func MapCat[I, O any](transform func(i I) []O, values []I) (result []O)
- func MapKeys[K comparable, V any](m map[K]V) (results []K)
- func MapLookup[K comparable, V any](m map[K]V) func(K) V
- func MapValues[K comparable, V any](m map[K]V) (results []V)
- func MapVoid[T any](f func(T), values []T)
- func Max[T LessThan](all []T) T
- func Min[T LessThan](all []T) T
- func Multiply[T Number](a, b T) T
- func None(inputs []bool) bool
- func PairsMap[K comparable, V any](pairs []Pair[K, V]) map[K]V
- func Partition[T any](length, increment int, values []T) (result [][]T)
- func Product[T Number](rolls []T) T
- func Range[N Number](start, stop N) (result []N)
- func RangeStep[N Number](start, stop, step N) (result []N)
- func Reduce[T any](calc func(a, b T) T, start T, values []T) (result T)
- func Remove[T any](predicate func(t T) bool, values []T) []T
- func Repeat[T any](n int, t T) (result []T)
- func Rest[T any](values []T) []T
- func SliceLookup[V any](s []V) func(int) V
- func SlicedIndexBy[K comparable, V any](key func(V) K, list []V) map[K][]V
- func SlicedKeyValueIndexBy[K comparable, V1, V2 any](kv func(V1) (K, V2), list []V1) map[K][]V2
- func SortAscending[C LessThan, V any](key func(V) C, original []V) (result []V)
- func SortDescending[C LessThan, V any](key func(V) C, original []V) (result []V)
- func Square[T Number](t T) T
- func String[T any](t T) string
- func Sum[T Number](rolls []T) T
- func Take[T any](n int, values []T) []T
- func TakeAllBut[T any](n int, values []T) []T
- func TakeWhile[T any](predicate func(T) bool, values []T) (result []T)
- func Unique[T comparable](values []T) []T
- func ZipMap[A comparable, B any](a []A, b []B) (result map[A]B)
- type Integer
- type LessThan
- type Number
- type Pair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByNumericValue ¶ added in v0.10.0
func ByNumericValue[T Number](t T) T
func Complement ¶
func DropAllBut ¶ added in v0.11.0
func FirstNonDefault ¶ added in v0.14.0
func FirstNonDefault[T comparable](values ...T) (zero T)
func FirstOrDefault ¶ added in v0.11.0
func FirstOrDefault[T any](values []T) (default_ T)
func Frequencies ¶ added in v0.3.0
func Frequencies[T comparable](values []T) map[T]int
func GroupBy ¶ added in v0.5.0
func GroupBy[K comparable, V any](key func(V) K, list []V) (result [][]V)
func IndexBy ¶
func IndexBy[K comparable, V any](key func(V) K, list []V) map[K]V
func KeyValueIndexBy ¶ added in v0.15.0
func KeyValueIndexBy[K comparable, V1, V2 any](kv func(V1) (K, V2), list []V1) map[K]V2
func LastOrDefault ¶ added in v0.11.0
func LastOrDefault[T any](values []T) (default_ T)
func Map2 ¶ added in v0.8.0
func Map2[Ia, Ib, O any](transform func(Ia, Ib) O, a []Ia, b []Ib) (result []O)
func MapKeys ¶ added in v0.7.0
func MapKeys[K comparable, V any](m map[K]V) (results []K)
func MapLookup ¶ added in v0.12.0
func MapLookup[K comparable, V any](m map[K]V) func(K) V
func MapValues ¶ added in v0.7.0
func MapValues[K comparable, V any](m map[K]V) (results []V)
func PairsMap ¶ added in v1.2.0
func PairsMap[K comparable, V any](pairs []Pair[K, V]) map[K]V
func SliceLookup ¶ added in v0.12.0
func SlicedIndexBy ¶
func SlicedIndexBy[K comparable, V any](key func(V) K, list []V) map[K][]V
func SlicedKeyValueIndexBy ¶ added in v0.15.0
func SlicedKeyValueIndexBy[K comparable, V1, V2 any](kv func(V1) (K, V2), list []V1) map[K][]V2
func SortAscending ¶
func SortDescending ¶
func TakeAllBut ¶ added in v0.11.0
func Unique ¶ added in v1.4.0
func Unique[T comparable](values []T) []T
func ZipMap ¶ added in v0.7.0
func ZipMap[A comparable, B any](a []A, b []B) (result map[A]B)
Types ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
should
Package should info: github.com/mdwhatcott/testing/should@v0.20.1 (a little copy-paste is better than a little dependency) AUTO-GENERATED: 2023-01-18 14:06:49.960562 -0700 MST m=+0.003159418
|
Package should info: github.com/mdwhatcott/testing/should@v0.20.1 (a little copy-paste is better than a little dependency) AUTO-GENERATED: 2023-01-18 14:06:49.960562 -0700 MST m=+0.003159418 |
Package risky houses convenience functions that introduce runtime risks (i.e.
|
Package risky houses convenience functions that introduce runtime risks (i.e. |
Click to show internal directories.
Click to hide internal directories.