ZVON > References > Haskell reference
| Indexes | Syntax | >> Prelude << | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: Prelude
Function: concatMap
Type: (a -> [b]) -> [a] -> [b]
Description: creates a list from a list generating function by application of this function on all elements in a list passed as the second argument
Related:

Example 1

Input: concatMap (enumFromTo 1) [1,3,5]

Output: [1,1,2,3,1,2,3,4,5]

Example 2

Input: concatMap (\x -> [(x,x+2,x/2)]) [1,3,5]

Output: [(1.0,3.0,0.5),(3.0,5.0,1.5),(5.0,7.0,2.5)]