How to "merge" / "map" two sparse maps into one?

Could you write a function to handle balls without a key and then use it in map.merge?