Skip to main content
Module

x/ahh/src/iterator.ts

Opinionated idiomatic features for TypeScript.
Latest
import * as ahh from "https://deno.land/x/ahh@v0.14.0/src/iterator.ts";

Composable iteration.

The Iterator abstract class defined here builds on-top of iteration protocols, which specifies how lazy iteration works. This also allows us to benefit from built-in language features, such as:

Classes

Implemented by Iterators that exclusively returns None after encountering the first None.

c
Iterator
abstract

Implemented by classes that can be iterated.

Implemented by Iterators that can be peeked.

Functions

Creates an Iterator that yields nothing.

Creates an Iterator that yields the result of fn each iteration.

Creates an Iterator that yields the next item from an iter that conforms to the [iteration protocols].

Creates an Iterator that yields exactly one item.

Creates an Iterator that endlessly yields item.

Creates an Iterator where each successive item is computed from the previous one.