iter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: BSD-3-Clause, BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package iter provides basic definitions related to iterators over sequences. This is a reduced binding: only the Seq and Seq2 types are defined. The Pull and Pull2 helpers rely on runtime coroutine primitives (newcoro/coroswitch via go:linkname) that mvm cannot link; use `for v := range seq` directly, which is handled natively by the interpreter's range-over-func support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Seq

type Seq[V any] func(yield func(V) bool)

Seq is an iterator over sequences of individual values. When called as seq(yield), seq calls yield(v) for each value v in the sequence, stopping early if yield returns false.

type Seq2

type Seq2[K, V any] func(yield func(K, V) bool)

Seq2 is an iterator over sequences of pairs of values, most commonly key-value pairs. When called as seq(yield), seq calls yield(k, v) for each pair (k, v) in the sequence, stopping early if yield returns false.

Jump to

Keyboard shortcuts

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