News for hackers. Stuff that matters.
Re:Haskell in ES6: Part 1 by nunull on Saturday November 14, 2015 @07:33AM (#10565441)
> head extracts the first element of a list, which must be non-empty.

Those functions operate on lists. I think it should read as follows.

    const head = (xs) => xs[0];
    const last = (xs) => xs[xs.length-1];
    const tail = (xs) => xs.slice(1);
    const init = (xs) => xs.slice(0, -1);
Am I missing something?
Re:Haskell in ES6: Part 1 by olalonde on Saturday November 14, 2015 @04:23PM (#10567319)
For some reason, the original author decided the arguments themselves were the "list" to operate on which is indeed a bit weird and non idiomatic.