ranges

package
v0.25.31 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Overview

Package ranges provides utility functions for working with iter.Seq ranges

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty added in v0.25.28

func Empty[T any]() iter.Seq[T]

Empty returns an empty RangeFunc of any type. It yields no values.

func Filter added in v0.25.28

func Filter[T any](iterator iter.Seq[T], predicate func(T) bool) iter.Seq[T]

Filter returns a new iterator that yields only the items from the input iterator for which the predicate function returns true.

func Join added in v0.25.28

func Join[T any](iterators ...iter.Seq[T]) iter.Seq[T]

Join combines multiple iterators into a single iterator that yields all items from each input iterator in sequence.

func Limit

func Limit[T any](max int, iterator iter.Seq[T]) iter.Seq[T]

Limit limits the number of items returned by an iter.Seq to the specified maximum

func Map added in v0.25.28

func Map[IN any, OUT any](iterator iter.Seq[IN], transform func(IN) OUT) iter.Seq[OUT]

Map transforms a rangeFunc of type T into a rangeFunc of type U using the provided transform function.

func Slice added in v0.25.20

func Slice[T any](rangeFunc iter.Seq[T]) []T

Slice converts an iter.Seq to a slice of T

func Unique added in v0.25.29

func Unique[T comparable](fn iter.Seq[T]) iter.Seq[T]

Unique returns an iterator that yields only unique items from the provided iterator.

func Values added in v0.25.28

func Values[T any](values ...T) iter.Seq[T]

Values returns a new iterator that yields the provided values

Types

This section is empty.

Jump to

Keyboard shortcuts

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