itertool

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: LGPL-2.1 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect[T any](iterable Iterable[T]) []T

func CollectN

func CollectN[T any](iterable Iterable[T], n int) []T

func Find

func Find[T any](iterable Iterable[T], lambda func(element *T) bool) *T

func ForEach

func ForEach[T any](iterable Iterable[T], lambda func(element *T))

Types

type EnumerateIterator

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

func Enumerate

func Enumerate[T any](iterable Iterable[T]) *EnumerateIterator[T]

func (*EnumerateIterator[T]) Next

func (e *EnumerateIterator[T]) Next() *Optional[Index[T]]

type FilterIterator

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

func Filter

func Filter[T any](iterable Iterable[T], lambda func(t *T) bool) *FilterIterator[T]

func (*FilterIterator[T]) Next

func (f *FilterIterator[T]) Next() *Optional[T]

type Index

type Index[T any] struct {
	Index int
	Value *T
}

type Iterable

type Iterable[T any] interface {
	Next() *Optional[T]
}

func Skip

func Skip[T any](iterable Iterable[T], count int) Iterable[T]

type MapIterator

type MapIterator[T any, O any] struct {
	// contains filtered or unexported fields
}

func Map

func Map[T any, O any](iterable Iterable[T], lambda func(t *T) O) *MapIterator[T, O]

func (*MapIterator[T, O]) Next

func (m *MapIterator[T, O]) Next() *Optional[O]

type Optional

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

func Null

func Null[T any]() *Optional[T]

func Of

func Of[T any](value T) *Optional[T]

func OfPointer

func OfPointer[T any](value *T) *Optional[T]

func (*Optional[T]) Export

func (o *Optional[T]) Export(out **Optional[T]) bool

func (*Optional[T]) Get

func (o *Optional[T]) Get() T

func (*Optional[T]) GetPointer

func (o *Optional[T]) GetPointer() *T

func (Optional[T]) IsNil

func (o Optional[T]) IsNil() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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