@mikuroxina/mini-fn
    Preparing search index...

    Function appendToHead

    • Appends the element to head of the list.

      Type Parameters

      • T

      Parameters

      • value: T

        The value to be appended.

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

      The appended list.

      Examples

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