Commonly Used List Processing Functions in FP
A list of commonly used functions for processing collections in FP languages or when adopting an FP style. Grouped by language in alphabetical order. The listing order for the functions is the same for every language. Some functions, though, are missing in some languages or there are alternative ways to accomplish the same goal.
Clojure
firstrestmapfilteror its dualremoveevery?or its dualnot-every?someor its dualnot-any?zipmapzip-with. There's no such function in Clojure, but the same thing can be achieved by passing at least two collections tomap.taketake-whiledropdrop-whilereduce
Please note that some of the functions above will probably be superseded by the new reducers library.
Erlang
hd/1tl/1lists:map/2lists:filter/2lists:all/2lists:any/2lists:zip2/2andlists:zip3/3lists:takewhile/2lists:dropwhile/2lists:foldl/3lists:foldr/3
Haskell
headtailmapfilterallor the closely relatedandanyor the closely relatedorzipor any of thezip3up tozip7in theData.ListmodulezipWithor any of thezipWith3up tozipWith7in theData.ListmoduletakedroptakeWhiledropWhilefoldlfoldr
JavaScript (using underscore.js)
firstrestmapfilterand its dualrejectallanyzipreduce/inject/foldlreduceRight/foldr