mapy

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromSlice added in v0.1.11

func FromSlice[T any, K comparable, V any](vs []T, f func(v T) (K, V)) map[K]V

FromSlice constructs a map by using f to extract keys and values from the given slice. NOTE: if f returns the same key multiple times, the map will contain the value of the last element in the slice for which f returns that key.

func Keys added in v0.1.0

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

func Map added in v0.1.6

func Map[K comparable, V any, T any](m map[K]V, f func(K, V) T) []T

func Values added in v0.1.5

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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