package
Version:
v0.5.0
Opens a new window with list of versions in this module.
Published: May 17, 2022
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func Filter[T any](s []T, f func(T) bool) []T
Filter filters values from a slice using a filter function.
It returns a new slice with only the elements of s
for which f returned true.
func Map[T1, T2 any](s []T1, f func(T1) T2) []T2
Map turns a []T1 to a []T2 using a mapping function.
This function has two type parameters, T1 and T2.
This works with slices of any type.
func Reduce[T1, T2 any](s []T1, initializer T2, f func(T2, T1) T2) T2
Reduce reduces a []T1 to a single value using a reduction function.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.