iter

package
v0.0.0-...-0095349 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(iterator Iter[bool]) bool

func Any

func Any(iterator Iter[bool]) bool

func CollectToMap

func CollectToMap[K comparable, V any](it Iter[tuple.T2[K, V]]) map[K]V

func CollectToSlice

func CollectToSlice[E any](it Iter[E]) []E

func Count

func Count[E any](it Iter[E]) int

func Filter

func Filter[E any](predicate func(E) bool) func(Iter[E]) Iter[E]

func Find

func Find[E any](predicate func(E) bool) func(Iter[E]) opt.Option[E]

func Fold

func Fold[B any, E any](init B, f func(B, E) B) func(Iter[E]) B

func ForEach

func ForEach[E any](f func(E)) func(Iter[E]) adt.Void

func Iterate

func Iterate[E any](generate func(E) E) func(init E) Iter[E]

func Map

func Map[A any, B any](f func(A) B) func(Iter[A]) Iter[B]

func Next

func Next[E any](iter Iter[E]) opt.Option[E]

func Reduce

func Reduce[E any](f func(E, E) E) func(Iter[E]) opt.Option[E]

func Skip

func Skip[E any](n int) func(Iter[E]) Iter[E]

func SkipWhile

func SkipWhile[E any](predicate func(E) bool) func(Iter[E]) Iter[E]

func Take

func Take[E any](n int) func(Iter[E]) Iter[E]

func TakeWhile

func TakeWhile[E any](predicate func(E) bool) func(Iter[E]) Iter[E]

func Zip

func Zip[A any, B any](iterA Iter[A]) func(Iter[B]) Iter[tuple.T2[A, B]]

Types

type Iter

type Iter[E any] struct {
	// contains filtered or unexported fields
}

func Enumerate

func Enumerate[E any](it Iter[E]) Iter[tuple.T2[int, E]]

func NewIter

func NewIter[E any](next func() opt.Option[E], sizeHint SizeHint) Iter[E]

func NewIterWithStaticSizeHintLowerBound

func NewIterWithStaticSizeHintLowerBound[E any](next func() opt.Option[E], sizeHint int) Iter[E]

func NewIterWithoutSizeHint

func NewIterWithoutSizeHint[E any](next func() opt.Option[E]) Iter[E]

func SliceIter

func SliceIter[E any](slice []E) Iter[E]

type SizeHint

type SizeHint struct {
	LowerBound int
	UpperBound opt.Option[int]
}

func GetSizeHint

func GetSizeHint[E any](iter Iter[E]) SizeHint

Jump to

Keyboard shortcuts

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