maps

package
v0.0.0-...-c6c3bcc Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyValues

func KeyValues[K comparable, V any](m map[K]V) []tuple.T2[K, V]

KeyValues returns an unsorted slice of Key-Value pairs.

func Keys

func Keys[K comparable, V any](m map[K]V) []K

Keys returns an unsorted slice of the keys of m.

func ProdKeys

func ProdKeys[K Number, V any](m map[K]V) (sum K)

ProdKeys multiplies all the keys of m.

func ProdValues

func ProdValues[K comparable, V Number](m map[K]V) (sum V)

ProdValues multiplies all the values of m.

func SortedKeyValues

func SortedKeyValues[K constraints.Ordered, V any](m map[K]V) []tuple.T2[K, V]

SortedKeyValues returns a slice of Key-Value pairs sorted by the keys.

func SortedKeys

func SortedKeys[K constraints.Ordered, V any](m map[K]V) []K

SortedKeys returns a sorted slice of the keys of m.

func SortedValues

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

SortedValues returns a sorted slice of values of m.

func SumKeys

func SumKeys[K Number, V any](m map[K]V) (sum K)

SumKeys sums up the keys of m.

func SumValues

func SumValues[K comparable, V Number](m map[K]V) (sum V)

SumValues sums up the values of m.

func Values

func Values[K comparable, V any](m map[K]V) []V

Values returns an unsorted slice of values of m.

func ValuesBySortedKeys

func ValuesBySortedKeys[K constraints.Ordered, V any](m map[K]V) []V

ValuesBySortedKeys returns a slice of values of m sorted by the keys of m.

Types

This section is empty.

Jump to

Keyboard shortcuts

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