Some higher-order functions for operating on lists or arrays have been repeatedly adopted or reinvented. The functions map, fold[l|r], and filter are found together in several programming languages, such as Scheme, ML, and Python, that don’t seem to have a common ancestor. I’m going with these three names to keep the question focused.
To show that the names are not universal, here is a sampling of names for equivalent functionality in other languages. C++ has transform instead of map and remove_if instead of filter (reversing the meaning of the predicate). Lisp has mapcar instead of map, remove-if-not instead of filter, and reduce instead of fold (Some modern Lisp variants have map but this appears to be a derived form.) C# uses Select instead of map and Where instead of filter. C#’s names came from SQL via LINQ, and despite the name changes, their functionality was influenced by Haskell, which was itself influenced by ML.
The names map, fold, and filter are widespread, but not universal. This suggests that they were borrowed from an influential source into other contemporary languages. Where did these function names come from?
8
The only universal word in your list is map
and it already appears in the original paper on Lisp in 1960 (under the guise of maplist
).
The paper also has search
(AKA filter
, AKA remove-if-not
).
I think the reason map
endured while the others have variants is that map
comes from relatively ancient, established, common & elementary math while catamorphism
(AKA reduce
AKA fold
&c) is a relatively advanced concept, from a relatively obscure recently developed (more or less simultaneously with CS) domain, and it was introduced (in the late 1980-ies) when reduce
was available in Lisp for over a decade.
Others (filter
AKA remove-if-not
) are even more ad hoc in CS/programming, so people felt even more comfortable picking their own name for them.
3