reiterate

package
v0.0.0-...-9900226 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: AGPL-3.0-or-later Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[A comparable, AS ~[]A](a A, as AS) bool

func Filter

func Filter[A any, AT ~[]A, F func(A) bool](as AT, f F) AT

func InPlaceReverse

func InPlaceReverse[A any, AS ~[]A](a AS)

func IndexOf

func IndexOf[A comparable, AS ~[]A](a A, as AS) int

func MakeReversed

func MakeReversed[A any, AS ~[]A](a AS) AS

func Map

func Map[A any, AT ~[]A, B any, BT ~[]B](as AT, f func(A) B) BT

func Next

func Next[E any](it Iterator[E]) (E, bool)

func SliceIter

func SliceIter[E any, T ~[]E](t T) *sliceIter[E, T]

func SubsliceIter

func SubsliceIter[E any, T ~[]E](t T, idx int) *sliceIter[E, T]

func ToSlice

func ToSlice[E any](it Iterator[E]) []E

func ZipTwo

func ZipTwo[A any, B any, AS ~[]A, BS ~[]B](a AS, b BS) *ziptwo[A, B]

Types

type Index

type Index[T any] struct {
	Index int
	Elem  T
}

type Iterator

type Iterator[E any] interface {
	MoveNext() bool
	Current() E
}

func Enumerate

func Enumerate[T any](i Iterator[T]) Iterator[Index[T]]

func EnumerateFrom

func EnumerateFrom[T any](i Iterator[T], startAt int) Iterator[Index[T]]

func FilterIter

func FilterIter[E any](i Iterator[E], f func(E) bool) Iterator[E]

func Flatten

func Flatten[T any, U any](src Iterator[T], f func(T) Iterator[U]) Iterator[U]

func MapIter

func MapIter[T any, U any](src Iterator[T], f func(T) U) Iterator[U]

Jump to

Keyboard shortcuts

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