use list comprehension in merge_with

In the spirit of 4df68b1b59b43a260ed887f849d8a7b2a9e9e92b.
The function actually gets marginally faster.