• Appends the element to head of the list.

    Type Parameters

    • T

    Parameters

    • value: T

      The value to be appended.

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

    The appended list.

    Examples

    import { List, appendToHead, singleton, toIterator } from "./list.ts";
    import { assertEquals } from "../deps.ts";

    const iter = toIterator(appendToHead(1)(singleton(4)));
    assertEquals(iter.next(), { value: 1, done: false });
    assertEquals(iter.next(), { value: 4, done: false });
    assertEquals(iter.next(), { value: undefined, done: true });

Generated using TypeDoc