Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ahh/src/iterator.ts>successors

Opinionated idiomatic features for TypeScript.
Go to Latest
function successors
import { successors } from "https://deno.land/x/ahh@v0.12.1/src/iterator.ts";

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

Examples

Example 1

import { default as I } from "./iterator.ts";

const iter = I.repeat("hello");

console.log(iter.next());

Parameters

init: Option<T>
fn: (_: T) => Option<T>