itools

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectErr

func CollectErr[T any](i iter.Seq[Pair[error, T]]) ([]T, error)

func Map

func Map[T, U any](i iter.Seq[T], mapper func(T) U) iter.Seq[U]

func Zip

func Zip[L, R any](left iter.Seq[L], right iter.Seq[R]) iter.Seq[Pair[L, R]]

Types

type Iterator

type Iterator[T any] iter.Seq[T]

func (Iterator[T]) Collect

func (i Iterator[T]) Collect() []T

func (Iterator[T]) First

func (i Iterator[T]) First(alt T) T

func (Iterator[T]) FirstOrDefault

func (i Iterator[T]) FirstOrDefault() T

func (Iterator[T]) Zip

func (i Iterator[T]) Zip(other Iterator[T]) iter.Seq[Pair[T, T]]

type Pair

type Pair[L, R any] struct {
	Left  L
	Right R
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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