Help us shape the future of Go! Take the 2026 Go Developer Survey

generic

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect[M ~map[K]V, GR ~[]R, K comparable, V, R any](f func(K, V) R) func(M) GR

func ConstNil

func ConstNil[M ~map[K]V, K comparable, V any]() M

ConstNil return a nil map

func DeleteAt

func DeleteAt[M ~map[K]V, K comparable, V any](k K) func(M) M

func Empty

func Empty[M ~map[K]V, K comparable, V any]() M

func Eq

func Eq[M ~map[K]V, K comparable, V any](e E.Eq[V]) E.Eq[M]

func Filter

func Filter[M ~map[K]V, K comparable, V any](f func(K) bool) func(M) M

Filter creates a new map with only the elements that match the predicate

func FilterMap

func FilterMap[M ~map[K]V1, N ~map[K]V2, K comparable, V1, V2 any](f func(V1) O.Option[V2]) func(M) N

FilterMap creates a new map with only the elements for which the transformation function creates a Some

func FilterMapWithIndex

func FilterMapWithIndex[M ~map[K]V1, N ~map[K]V2, K comparable, V1, V2 any](f func(K, V1) O.Option[V2]) func(M) N

FilterMapWithIndex creates a new map with only the elements for which the transformation function creates a Some

func FilterWithIndex

func FilterWithIndex[M ~map[K]V, K comparable, V any](f func(K, V) bool) func(M) M

FilterWithIndex creates a new map with only the elements that match the predicate

func FromEntries

func FromEntries[M ~map[K]V, GT ~[]T.Tuple2[K, V], K comparable, V any](fa GT) M

func Has

func Has[M ~map[K]V, K comparable, V any](k K, r M) bool

func IsEmpty

func IsEmpty[M ~map[K]V, K comparable, V any](r M) bool

func IsNil

func IsNil[M ~map[K]V, K comparable, V any](m M) bool

IsNil checks if the map is set to nil

func IsNonEmpty

func IsNonEmpty[M ~map[K]V, K comparable, V any](r M) bool

func IsNonNil

func IsNonNil[M ~map[K]V, K comparable, V any](m M) bool

IsNonNil checks if the map is set to nil

func Keys

func Keys[M ~map[K]V, GK ~[]K, K comparable, V any](r M) GK

func Lookup

func Lookup[M ~map[K]V, K comparable, V any](k K) func(M) O.Option[V]

func Map

func Map[M ~map[K]V, N ~map[K]R, K comparable, V, R any](f func(V) R) func(M) N

func MapRef

func MapRef[M ~map[K]V, N ~map[K]R, K comparable, V, R any](f func(*V) R) func(M) N

func MapRefWithIndex

func MapRefWithIndex[M ~map[K]V, N ~map[K]R, K comparable, V, R any](f func(K, *V) R) func(M) N

func MapWithIndex

func MapWithIndex[M ~map[K]V, N ~map[K]R, K comparable, V, R any](f func(K, V) R) func(M) N

func MonadMap

func MonadMap[M ~map[K]V, N ~map[K]R, K comparable, V, R any](r M, f func(V) R) N

func MonadMapRef

func MonadMapRef[M ~map[K]V, N ~map[K]R, K comparable, V, R any](r M, f func(*V) R) N

func MonadMapRefWithIndex

func MonadMapRefWithIndex[M ~map[K]V, N ~map[K]R, K comparable, V, R any](r M, f func(K, *V) R) N

func MonadMapWithIndex

func MonadMapWithIndex[M ~map[K]V, N ~map[K]R, K comparable, V, R any](r M, f func(K, V) R) N

func Reduce

func Reduce[M ~map[K]V, K comparable, V, R any](f func(R, V) R, initial R) func(M) R

func ReduceRef

func ReduceRef[M ~map[K]V, K comparable, V, R any](f func(R, *V) R, initial R) func(M) R

func ReduceRefWithIndex

func ReduceRefWithIndex[M ~map[K]V, K comparable, V, R any](f func(K, R, *V) R, initial R) func(M) R

func ReduceWithIndex

func ReduceWithIndex[M ~map[K]V, K comparable, V, R any](f func(K, R, V) R, initial R) func(M) R

func Singleton

func Singleton[M ~map[K]V, K comparable, V any](k K, v V) M

func Size

func Size[M ~map[K]V, K comparable, V any](r M) int

func ToArray

func ToArray[M ~map[K]V, GT ~[]T.Tuple2[K, V], K comparable, V any](r M) GT

func ToEntries

func ToEntries[M ~map[K]V, GT ~[]T.Tuple2[K, V], K comparable, V any](r M) GT

func Union

func Union[M ~map[K]V, K comparable, V any](m Mg.Magma[V]) func(M) func(M) M

func UnionMonoid

func UnionMonoid[N ~map[K]V, K comparable, V any](s S.Semigroup[V]) M.Monoid[N]

func UnionSemigroup

func UnionSemigroup[N ~map[K]V, K comparable, V any](s S.Semigroup[V]) S.Semigroup[N]

func UpsertAt

func UpsertAt[M ~map[K]V, K comparable, V any](k K, v V) func(M) M

func Values

func Values[M ~map[K]V, GV ~[]V, K comparable, V any](r M) GV

Types

This section is empty.

Jump to

Keyboard shortcuts

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