ABSTRACT

Three of the most important higher-order functions in any functional language are map, filter, and fold (or reduce). Map applies a function to each element of a list, resulting in a new list of the same length; filter removes unwanted elements from a list, producing a potential shorter list; and fold combines all the elements in a list into a single value. These functions are available in all three languages, although Java supports them only for streams, not lists.