seq

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunk added in v0.3.0

func Chunk[T any](s iter.Seq[T], n int) iter.Seq[iter.Seq[T]]

Chunk returns an iterator over consecutive elements of up to n elements of s.

func Drop

func Drop[T any](s iter.Seq[T], n int) iter.Seq[T]

Drop returns new iter.Seq that yields all elements from the argument except first n ones.

If n < 0, iter.Seq that yields all elements from the argument.

func DropWhile

func DropWhile[T any](s iter.Seq[T], predicate func(T) bool) iter.Seq[T]

DropWhile returns new iter.Seq that yields the elements but dropped longest prefix satisfy the predicate from the argument.

func Take

func Take[T any](s iter.Seq[T], n int) iter.Seq[T]

Take returns new iter.Seq that yields first n elements from the argument.

func TakeWhile

func TakeWhile[T any](s iter.Seq[T], predicate func(T) bool) iter.Seq[T]

TakeWhile return new iter.Seq that yields longest prefix of elements from the argument.

func Zip added in v0.2.0

func Zip[A, B any](as iter.Seq[A], bs iter.Seq[B]) iter.Seq2[A, B]

Zip returns new iter.Seq2 yields elements that by combining corresponding elements in pairs from each sequences.

func ZipAll added in v0.2.0

func ZipAll[A, B any](as iter.Seq[A], bs iter.Seq[B], fillA A, fillB B) iter.Seq2[A, B]

Types

This section is empty.

Jump to

Keyboard shortcuts

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