Ramda chain usage
From the documentation : var duplicate = n => [n, n]; R.chain(duplicate, [1, 2, 3]); //=> [1, 1, 2, 2, 3, 3] R.chain(R.append, R.head)([1, 2, 3]); //=> [1, 2, 3, 1] The first example is very straight forward, it applies duplicate() to every element in the array and concatenates the result. But I am having trouble understanding the second example. How exactly is it mapping R.append + R.head over the array? Can someone please provide a step by step explanation for the second example ? I am familiar with compose and currying. Thanks The second example is showing how R.chain can be used things