I am trying to "join" two lists together. Both lists are of the same type and each instance of that type has a unique key. If there are instances with the same key in both lists, then I would like to merge the two instances together with a custom merge function. The final list of items should contain the merged elements plus the instances that were only in one of the two lists in the first place.
This is similar to a Union and a Join, but seems to be subtly different to each of them. A union would give me the right list of keys, but has no facility to merge instances where they share the same key - it would just return one of the instances and ignore the other. A join allows me to merge the repeated instances by supplying a function but it would only return the elements that were in both lists - not one or the other.
Have I missed a good built-in way to do this?