Documentation
¶
Overview ¶
Package funcitr provides functional styled iteration over collections of different types.
Index ¶
- func FilterStrings(strings []string, filter func(string) bool) []string
- func MapFloat32s(floats []float32, mapFunc func(float32) float32) []float32
- func MapFloat64s(floats []float64, mapFunc func(float64) float64) []float64
- func MapInt64s(ints []int64, mapFunc func(int64) int64) []int64
- func MapInts(ints []int, mapFunc func(int) int) []int
- func MapSlice(sl []interface{}, mapFunc func(interface{}) interface{}) []interface{}
- func MapStrings(strings []string, mapFunc func(string) string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterStrings ¶
FilterStrings iterates over a slice of strings calling the filter function for each value in the slice. The output slice contains contains all input strings for which the filter function returned true. Order is maintained from input to output.
func MapFloat32s ¶
MapFloat32s iterates over a slice of floats calling the mapping function for each value in the slice. The mapped values are returned in a new slice, and their order corresponds with the input slice (The Nth item in the output slice is the result returned by the mapping function when given the Nth item from the input slice.)
func MapFloat64s ¶
MapFloat64s iterates over a slice of float64s calling the mapping function for each value in the slice. The mapped values are returned in a new slice, and their order corresponds with the input slice (The Nth item in the output slice is the result returned by the mapping function when given the Nth item from the input slice.)
func MapInt64s ¶
MapInt64s iterates over a slice of int64s calling the mapping function for each value in the slice. The mapped values are returned in a new slice, and their order corresponds with the input slice (The Nth item in the output slice is the result returned by the mapping function when given the Nth item from the input slice.)
func MapInts ¶
MapInts iterates over a slice of ints calling the mapping function for each value in the slice. The mapped values are returned in a new slice, and their order corresponds with the input slice (The Nth item in the output slice is the result returned by the mapping function when given the Nth item from the input slice.)
func MapSlice ¶
func MapSlice(sl []interface{}, mapFunc func(interface{}) interface{}) []interface{}
MapSlice iterates over a slice of calling the mapping function for each value in the slice. The mapped values are returned in a new slice, and their order corresponds with the input slice (The Nth item in the output slice is the result returned by the mapping function when given the Nth item from the input slice.)
func MapStrings ¶
MapStrings iterates over a slice of strings calling the mapping function for each value in the slice. The mapped values are returned in a new slice, and their order corresponds with the input slice (The Nth item in the output slice is the result returned by the mapping function when given the Nth item from the input slice.)
Types ¶
This section is empty.