Documentation
¶
Overview ¶
Package collections provides small generic collection primitives shared across the handwritten Go, so a site carries a typed value instead of reimplementing a set operation or a keyed lookup locally.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyedList ¶
type KeyedList[K comparable, V any] struct { // contains filtered or unexported fields }
KeyedList is a list of values each carrying a key of type K.
func NewKeyedList ¶
func NewKeyedList[K comparable, V any](key func(V) K, values []V) KeyedList[K, V]
NewKeyedList returns a keyed list looked up by the key each value carries.
type Set ¶
type Set[T comparable] []T
Set is a set of comparable values, kept as a slice without duplicates.
Click to show internal directories.
Click to hide internal directories.