These are chat archives for ramda/ramda
I have a nested list:
const list = [ ['a', ['alpha'], ['b', ['bravo'], ['a', ['charlie'], ['c', ['echo'], ['a', ['foxtrot'], ['b', ['gamma'], ]
I need to combine items with identical values for the first item to result in this:
const mergedList = [ ['a', ['alpha', 'charlie', 'foxtrot']], ['b', ['bravo', 'gamma']], ['c', ['echo'], ]
I can guarantee that each list will only contain two items, and that the second item will be a shallow array. I can't convert to object as order is critical.
compose(toPairs, reduce(mergeWith(concat), ), map(apply(objOf)))(list)