You're thinking of a finite map, also called a hash table or a dictionary.
The map function takes a function and a list and applies the function to every element of the list:
map double [1,2,3] = [2,4,6]The map function takes a function and a list and applies the function to every element of the list:
map double [1,2,3] = [2,4,6]
Wait. Why should a map care about what exceptions it's arguments can throw?
A map is storing a thingit. A thingit should exist independently before it gets placed into a map. Placing a thingit into a map should not invoke anything on the thingit. The only exceptions coming back from attempting to place a thingit into a map should be exceptions caused by the map.
What am I missing?
Obviously, there are maps that conflate themselves and do things like take ownership when an object is placed into the map. But that's not the general case and presumably you wrote the map specifically with that in mind.