Theory

map captures the elementโ€‘wise transformation pattern.

Type:

Semantics

map _ []     = []
map f (x:xs) = f x : map f xs

Example

squares = map (^2)
shout   = map toUpper

Etaโ€‘contraction often yields pointโ€‘free style: shout = map toUpper. Lazy and fusionโ€‘friendly map f (map g xs) rewrites to map (f . g) xs.