iterable

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToChannel

func ToChannel[A any](ctx context.Context, i Iterator[A]) <-chan A

func ToSlice

func ToSlice[A any](i Iterator[A]) []A

Types

type FunctionIterator

type FunctionIterator[A any] struct {
	F func() *A
}

func (*FunctionIterator[A]) Next

func (f *FunctionIterator[A]) Next() *A

type Iterable

type Iterable[A any] interface {
	Iterator() Iterator[A]
}

type Iterator

type Iterator[A any] interface {
	Next() *A // TODO should this be (A, bool) ?
}

Jump to

Keyboard shortcuts

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