Applying Functions to Lists

Many computations are conveniently specified in terms of applying functions in parallel to many elements in a list. The Wolfram Language provides a suite of elegant functional programming constructs for doing this. In the Wolfram Language, mathematical functions are automatically taken to be "listable", so that they are always applied to every element in a list.

Map (/@) map a function over a list, at specified levels

Apply (@@, @@@) apply a function to a list, at specified levels

MapIndexed map a function, including index information

MapAt map a function at particular positions

Scan scan over every element of a list, applying a function

BlockMap  ▪  ArrayFilter

FoldList successively apply a function, "folding in" elements from a list

ComposeList  ▪  Outer  ▪  Inner  ▪  Accumulate  ▪  Differences  ▪  Ratios

MapThread map a function across corresponding elements in multiple lists

Thread "thread" a function across lists that appear in its arguments

Listable attribute for any function to automatically thread over lists

Dataset set up a nested list to be manipulated as a structured dataset