collections

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone[T any](slice []T) []T

func Concat

func Concat[T any](slices ...[]T) []T

func Filter

func Filter[T any](elements []T, filterFn func(T) bool) []T

func FindFirstIndex

func FindFirstIndex[T any](elements []T, predicate func(T) bool) int

func Generate

func Generate[T any](count uint, generator func() T) []T

func InsertAt

func InsertAt[T any](elements []T, element T, index uint) []T

func Map

func Map[TIn any, TOut any](elements []TIn, mapper func(TIn) TOut) []TOut

func Remove

func Remove[T any](elements []T, index int) []T

func Shuffle

func Shuffle[T any](elements []T) []T

Types

type Cycler

type Cycler[T any] struct {
	// contains filtered or unexported fields
}

func NewCycler

func NewCycler[T any](elements []T) *Cycler[T]

func (*Cycler[T]) DropCurrent

func (cycler *Cycler[T]) DropCurrent()

func (*Cycler[T]) Next

func (cycler *Cycler[T]) Next() T

func (*Cycler[T]) Size

func (cycler *Cycler[T]) Size() int

Jump to

Keyboard shortcuts

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