loading...

re: Why is map called map? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: The answers there are good, but I want to add one more point: the 'map' operation is one that, in mathematics, makes some guarantees. Calling it 'm...
 

thanks for sharing this!

 

I would also add that programming adds to the original mathematics (without mentioning algebraic data structures) by enabling a data structure, such as an array, to be "mappable". That is, the data structure should support certain functions/methods which enable the map function to operate.

The details of course vary by language, but are crucial in enabling a generic map function to work with arrays, linked lists, trees, graphs, sets etc. So for Clojure, any data structure can be mapped if it implements 'first', 'rest' and 'cons'.

Code of Conduct Report abuse