Appends the element to head of the list.
The value to be appended.
The appended list.
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 }); Copy
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 });
Appends the element to head of the list.