import { I } from "https://deno.land/x/ahh@v0.10.3/mod.ts";
Functionality for Iterator
.
Static Methods
Consumes an Iterator
until f
returns true
, and returns
true
if it does.
Creates an Iterator
which yields the current iteration as well
as the next value.
Creates an Iterator
that returns items when f
returns true
.
Consumes an Iterator
until f
returns true
and returns the
item.
Consumes an Iterator
and calls f
on each item to fold it into
init
.
Consumes an Iterator
and calls f
on each item.
Creates an Iterator
that calls f
on each item and yeilds the
original item.
Creates an Iterator
that calls f
on each item and yeilds the
result.
Consume the next value of an Iterator
and return it if f
returns true
.
Creates an Iterator
that endlessly yields an item.
Example
import { I } from "./mod.ts";
const iter = I.repeat(1);
console.log(iter.next()); // 1
console.log(iter.next()); // 1
console.log(iter.next()); // 1
Creates an Iterator
that skips items while f
returns true
.
Creates an Iterator
where each successive item is computed from
the preceding one.
Creates an Iterator
that yields the first n
items.
Creates an Iterator
that yields items while f
returns true
.