collections

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

collections provides a set of generic collection types and utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Shuffle

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

Shuffle shuffles the items in the given slice.

Types

type ParralelRangeable

type ParralelRangeable[T any] interface {
	// Range returns an iterator sequence of type T.
	RangeParralel(yield func(item T) bool)
}

type Rangeable

type Rangeable[T any] interface {
	// Range returns an iterator sequence of type T.
	Range(yield func(item T) bool)
}

type Readable

type Readable[T any] interface {
	// Read returns an iterator sequence of type T.
	Read() iter.Seq[T]
}

Readable is a generic interface that represents a readable collection of items of any type T. It defines a single method, Read, which returns an iterator sequence of type T.

Jump to

Keyboard shortcuts

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