• Maps the function from T to U onto List.

    Type Parameters

    • T

    • U

    Parameters

    • f: ((t) => U)

      The function to be mapped.

        • (t): U
        • Parameters

          • t: T

          Returns U

    Returns ((list) => List<U>)

    The function mapped on List.

    Examples

    import { iota, successors, toIterator, map } from "./list.ts";
    import { assertEquals } from "../deps.ts";

    const mapped = toIterator(map((x: number) => x * 3 + 1)(iota));
    assertEquals(mapped.next(), { value: 1, done: false });
    assertEquals(mapped.next(), { value: 4, done: false });
    assertEquals(mapped.next(), { value: 7, done: false });
    assertEquals(mapped.next(), { value: 10, done: false });

Generated using TypeDoc