collection

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: LGPL-2.1 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All[K comparable, V any](m map[K]V, f Pred[K, V]) map[K]V

func Any

func Any[K comparable, V any](m map[K]V, f Pred[K, V]) (k K, v V, ok bool)

func Collect

func Collect[K comparable, V any](ms ...map[K]V) map[K][]V

func Enum

func Enum[V any](s []V) map[int]V

func Equal

func Equal[K, V comparable](m0, m1 map[K]V) bool

func Exists

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

func Filter

func Filter[V any](s []V, f Pred[int, V]) []V

func Fold

func Fold[V0 any, V1 any](s []V0, init V1, f func(idx int, val V0, accum V1) V1) V1

func Forall

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

func Inverse

func Inverse[K, V comparable](m map[K]V) (map[V]K, bool)

func Join

func Join[K, V comparable](ms ...map[K]V) map[K]V

func Keys

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

func Map

func Map[K0, K1 comparable, V0, V1 any](m map[K0]V0, f func(key K0, val V0) (K1, V1)) map[K1]V1

func Meet

func Meet[K, V comparable](ms ...map[K]V) map[K]V

func Roll

func Roll[K comparable, V any](s []K, token V) map[K]V

func Sub

func Sub[K, V comparable](m0, m1 map[K]V) bool

func Unenum

func Unenum[K interface {
	comparable
	cmp.Ordered
}, V any](m map[K]V) []V

func Ungraph

func Ungraph[K comparable, V any](s []Pair[K, V]) map[K]V

func Unroll

func Unroll[K comparable, V any](m map[K]V) (k []K, v []V)

func Values

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

func Zip

func Zip[K comparable, V any](keys []K, vals []V) map[K]V

Types

type Pair

type Pair[A, B any] struct {
	// contains filtered or unexported fields
}

func Graph

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

type Pred

type Pred[K, V any] func(key K, val V) bool

Jump to

Keyboard shortcuts

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