eqset

package
v0.0.0-...-9ede9a0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: CC0-1.0, MIT-0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromFunc

func FromFunc[V any, T comparable](vv iter.Seq[V], f func(v V) T) dryad.Set[T]

FromFunc constructs a new set by applying the given function to each value in the given slice and collecting its return values in the new set.

func FromKeys

func FromKeys[K comparable, V any](m map[K]V) dryad.Set[K]

FromKeys constructs a new set using the keys of a map.

func MapToOrd

func MapToOrd[T comparable, S cmp.Ordered](
	src dryad.Set[T],
	f func(T) S,
) dryad.Set[S]

MapToOrd uses the given function to map the elements of the given set of comparable elements to a newly allocated set of ordered type elements.

func New

func New[T comparable](vv ...T) dryad.Set[T]

New constructs a new set.

func ToMap

func ToMap[K comparable, V any](set dryad.Set[K], v V) map[K]V

ToMap uses the set's elements as keys in a newly allocated map.

The given value is assigned as the initial value of every item in the map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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