maps

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareMapIndexBy

func CompareMapIndexBy[A comparable, B any](key A, compare Comparator[B]) Comparator[map[A]B]

CompareMapIndexBy compares a single index

func CompareMapIndexOrd

func CompareMapIndexOrd[A comparable, B Ord[B]](key A) Comparator[map[A]B]

func CompareMapIndexOrdered

func CompareMapIndexOrdered[A comparable, B constraints.Ordered](key A) Comparator[map[A]B]

func CompareMapPairwiseBy

func CompareMapPairwiseBy[A constraints.Ordered, B any](compare Comparator[B]) Comparator[map[A]B]

CompareMapPairwiseBy works by project a map to a list, therefore it's inefficient and probably

best to avoid using unless absolutely necessary!
Note: while `map` requires `A` to be `comparable`, *comparing* maps requires `A` to be Ordered
as well!

func CompareMapPairwiseOrd

func CompareMapPairwiseOrd[A constraints.Ordered, B Ord[B]]() Comparator[map[A]B]

func CompareMapPairwiseOrdered

func CompareMapPairwiseOrdered[A constraints.Ordered, B constraints.Ordered]() Comparator[map[A]B]

func EqualMapIndexBy

func EqualMapIndexBy[A comparable, B any](key A, equal Equaler[B]) Equaler[map[A]B]

EqualMapIndexBy equals a single index

func EqualMapIndexComparable

func EqualMapIndexComparable[A comparable, B comparable](key A) Equaler[map[A]B]

func EqualMapIndexEq

func EqualMapIndexEq[A comparable, B Eq[B]](key A) Equaler[map[A]B]

func EqualMapPairwiseBy

func EqualMapPairwiseBy[A comparable, B any](equal Equaler[B]) Equaler[map[A]B]

EqualMapPairwiseBy works by project a map to a list, therefore it's inefficient and probably

best to avoid using unless absolutely necessary!

func EqualMapPairwiseComparable

func EqualMapPairwiseComparable[A comparable, B comparable]() Equaler[map[A]B]

func EqualMapPairwiseEq

func EqualMapPairwiseEq[A comparable, B Eq[B]]() Equaler[map[A]B]

func FromSliceBy added in v0.1.3

func FromSliceBy[A comparable, B any](merge func(B, B) B, ps []*Pair[A, B]) map[A]B

func Map added in v0.1.3

func Map[A comparable, B, C any](f func(B) C, xs map[A]B) map[A]C

func Merge

func Merge[A comparable, B Ord[B]](m1 map[A]B, m2 map[A]B) map[A]B

func MergeBy

func MergeBy[A comparable, B any](resolve func(A, B, B) B, m1 map[A]B, m2 map[A]B) map[A]B

func ToSlice

func ToSlice[A comparable, B any](m map[A]B) []*Pair[A, B]

Types

This section is empty.

Jump to

Keyboard shortcuts

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