source

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

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

Empty creates an iter.Seq that yields nothing.

func Gen

func Gen[N core.Integer](from N, to N) iter.Seq[N]

Gen creates an iter.Seq that yield number in range.

If `to` less-equal than `from`, yield nothing as Empty.

Example:

source.Gen(2,5) => seq: 2,3,4
source.Gen(2,1) => seq:

func Once

func Once[E any](v E) iter.Seq[E]

Once creates an iter.Seq that yields an element exactly once.

func Repeat

func Repeat[E any](v E) iter.Seq[E]

Repeat creates an iter.Seq that endlessly repeats a single element.

func RepeatTimes

func RepeatTimes[E any, N core.Integer](v E, n N) iter.Seq[E]

RepeatTimes creates an iter.Seq that repeats a single element a given number of times.

func Variadic

func Variadic[E any](elems ...E) iter.Seq[E]

Variadic creates an iter.Seq from variadic elements.

Types

This section is empty.

Jump to

Keyboard shortcuts

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