Pudu programming language
Menu
API reference

Std.Iter.Sequence

1 declaration

trait

Sequence

This declaration names behavior that types can implement.

What it does

A value that produces a sequence of items.

S is the state the walk carries and T is what it yields. begin answers

the state to start from; advance answers the next item and the state after

it, or None when the sequence is finished.

The state is passed rather than mutated, so a sequence is an ordinary value:

it can be held, copied, and started again without anything having changed

underneath. Two walks of the same value see the same items.

for item in value uses this. A type implementing it is iterable with no

further ceremony, and a type that is not says so at the for rather than

part way through one.

Read the signature

  • This declaration has no value signature because it introduces a type or trait.

Back to Std.IterSearch related declarations