Map (higher-order function) (source code)

= Map
{disambiguate=higher-order function}
{wiki}

= Map function
{synonym}

Apply a <function> to each element of a collection while retaining its arrangement. On <lists>, `map f [] = []` and `map f (x:xs) = f x : map f xs`. Its <principal type> in <Haskell> is `(a -> b) -> [a] -> [b]`. The element types may change independently; no <equality test> or ordering of elements is required.