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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cycle

func Cycle(entry any) (iterator *cycler, err error)

func Flatten

func Flatten(entry any) (output []any, err error)

func NewCycler

func NewCycler(entry []any) *cycler

func Repeat

func Repeat(entry any) *repeater

func Reversed

func Reversed(entry any) (output any, err error)

func Slice

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

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

func NewCounter

func NewCounter(start, step int, reverse bool) *Counter

func (*Counter) Count

func (iter *Counter) Count() int

func (*Counter) Jump

func (iter *Counter) Jump(n int) int

func (*Counter) Reset

func (iter *Counter) Reset()

type Iterator

type Iterator interface {
	Next() bool
	Value() any
	Pour() any
}

func Accumulate

func Accumulate(handler, entry any) (iterator Iterator, err error)

func Chain

func Chain(entries ...any) (iterator Iterator, err error)

func DropWhile

func DropWhile(condition func(any) bool, entry any) (iterator Iterator, err error)

func Enumerate

func Enumerate(entry any, start, end, step int) (iterator Iterator, err error)

func Filter

func Filter(handler, entry any) (iterator Iterator, err error)

func GroupBy

func GroupBy(entry any, by func(any) any) (iterator Iterator, err error)

func Map

func Map(handler, entry any) (iterator Iterator, err error)

func NewAccumulator

func NewAccumulator(entry []any, handler func(any, any) any) Iterator

func NewListConvertor

func NewListConvertor(entry []any, handler func(any) any) Iterator

func NewListEnumerator

func NewListEnumerator(entry []any, start, end, step int) Iterator

func NewListFilter

func NewListFilter(entry []any, handler func(any) bool) Iterator

func NewListIterator

func NewListIterator(entry []any) Iterator

func NewMapIterator

func NewMapIterator(entry map[any]any) Iterator

func NewPairIterator

func NewPairIterator(entry []any) Iterator

func NewSliceIterator

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

func NewZipIterator

func NewZipIterator(entries [][]any, length int) Iterator

func PairWise

func PairWise(entry any) (iterator Iterator, err error)

func TakeWhile

func TakeWhile(condition func(any) bool, entry any) (iterator Iterator, err error)

func Zip

func Zip(entries ...any) (iterator Iterator, err error)

func ZipLongest

func ZipLongest(entries ...any) (iterator Iterator, err error)

Jump to

Keyboard shortcuts

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