itertools

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Slice

func Slice[T any](entry []T, start, end, step int) (slice []T, err error)

Types

type Accumulator

type Accumulator[T any] interface {
	Next() bool
	Value() T
	Pour() T
}

func Accumulate

func Accumulate[T any](entry []T, handler func(T, T) T) Accumulator[T]

type Enumerator

type Enumerator[T any] interface {
	Next() bool
	Value() *enumItem[T]
	Pour() []*enumItem[T]
}

func Enumerate

func Enumerate[T any](entry []T, start, end, step int) (iterator Enumerator[T], err error)

type ListIterator

type ListIterator[T any] interface {
	Next() bool
	Value() T
	Pour() []T
}

func Chain

func Chain[T any](entries ...[]T) ListIterator[T]

func Cycle

func Cycle[T any](entry []T) ListIterator[T]

func DropWhile

func DropWhile[T any](condition func(T) bool, entry []T) ListIterator[T]

func GroupBy

func GroupBy[T any, U comparable](entry []T, by func(T) U) ListIterator[[]T]

func Map

func Map[E, R any](handler func(E) R, entry []E) ListIterator[R]

func NewListIterator

func NewListIterator[T any](entry []T) ListIterator[T]

func NewSliceIterator

func NewSliceIterator[T any](entry []T, start, end, step int) ListIterator[T]

func PairWise

func PairWise[T any](entry []T) ListIterator[[2]T]

func Repeat

func Repeat[T any](entry T, count int) ListIterator[T]

func Reversed

func Reversed[T any](entry []T) ListIterator[T]

func TakeWhile

func TakeWhile[T any](condition func(T) bool, entry []T) ListIterator[T]

func Zip

func Zip[T any](entries ...[]T) (iterator ListIterator[[]T], err error)

func ZipLongest

func ZipLongest[T any](entries ...[]T) (iterator ListIterator[[]T], err error)

type ZipIterator

type ZipIterator[T, U any] interface {
	Next() bool
	Value() *zipPair[T, U]
	Pour() []*zipPair[T, U]
}

func ZipPair

func ZipPair[T, U any](entry1 []T, entry2 []U) ZipIterator[T, U]

func ZipPairLongest

func ZipPairLongest[T, U any](entry1 []T, entry2 []U) ZipIterator[T, U]

Jump to

Keyboard shortcuts

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