Documentation ¶
Overview ¶
Package slice provides common utility functions to Go slices.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlatMap ¶
FlatMap converts all values of a slice using the provided function. As the function returns slices, all of them are appended to a single long slice.
func Flatten ¶ added in v0.0.8
func Flatten[A any](ass [][]A) (aas []A)
Flatten simplifies a slice of slices to just a slice.
Types ¶
type Set ¶ added in v0.0.6
type Set[A comparable] map[A]struct{}
Set is a way to represent sets in Go.
func ToSet ¶ added in v0.0.6
func ToSet[A comparable](as []A) (s Set[A])
ToSet converts a slice to a set.
Click to show internal directories.
Click to hide internal directories.