I’m glad you ask, as I haven’t thought of this
Dict.merge is in my opinion the crux of any potential problem with my suggestion.
What do you think about this?
{-
The most general way of combining two dictionaries.
You provide three accumulators for when a given key appears:
- Only in the left dictionary.
- In both dictionaries.
- Only in the right dictionary.
You then traverse all the keys from lowest to highest,
building up whatever you want.
-}
Dict.merge
: (k1 → v1 → result → result)
-> (k1 → k2 -> v1 → v2 → result → result)
-> (k2 → v2 → result → result)
-> Dict k1 v1
-> Dict k2 v2
-> result
-> result
Given Dict.union and Dict.intersect give preference to values of the 1st Dict, I’d say the comparison-function of the first Dict is preferred too, for consistency. I don’t see this as a problem in any way: You’re getting all the values, mainly based on the 1st Dict.
The weakness of this approach with Dict.merge is that the comparison-function that established uniqueness in the 2nd Dict won’t be the one that establishes uniqueness for Dict.merge, which is definitely an inconsistency.
How bad is it though?
And as we discussed, the problem is only relevant for the case of providing a custom comparison-function, which you already debunked for it’s performance implications 
I’m assuming none of this is a problem if union-types are comparable, which also seems interesting to explore!