maps

package
v0.0.0-...-d8be82f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapFilter

func MapFilter[K comparable, V any](m map[K]V, f func(V) bool) map[K]V

MapFilter returns a new map, containing only those values for which the filter function returns true.

func MapMapValues

func MapMapValues[K comparable, V1, V2 any](m map[K]V1, f func(K, V1) V2) map[K]V2

MapMapValues applies a function to each value in a map, yielding a map with the new values (and type).

func MapMax

func MapMax[K comparable, V constraints.Ordered](m map[K]V) V

MapMax returns the maximum value from a map.

func Sum

func Sum[K comparable, V1 any, V2 constraints.Integer | constraints.Float | constraints.Complex](m map[K]V1, f func(V1) V2) V2

Sum returns the sum of values the function returns from a map.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL