concatMap

Map a function over all the elements of a container and concatenate the resulting lists.

Examples

Basic usage:
>>> concatMap (take 3) [[1..], [10..], [100..], [1000..]]
[1,2,3,10,11,12,100,101,102,1000,1001,1002]
>>> concatMap (take 3) (Just [1..])
[1,2,3]
Map a function returning a list over a list and concatenate the results. concatMap can be seen as the composition of concat and map.
concatMap f xs == (concat . map f) xs
>>> concatMap (\i -> [-i,i]) []
[]

>>> concatMap (\i -> [-i,i]) [1,2,3]
[-1,1,-2,2,-3,3]
Map a function over a ByteString and concatenate the results
Map a function over a ByteString and concatenate the results
O(n) Map a function over a Text that results in a Text, and concatenate the results.
Map a function over a stream that results in a stream and concatenate the results. Properties
unstream . concatMap (stream . f) . stream = concatMap f
Map a function over a vector and concatenate the results.
Map a function over a vector and concatenate the results.
Map a function over a vector and concatenate the results.
Map a function over a vector and concatenate the results.
Map a function over a vector and concatenate the results.
Apply the function to each value in the stream, resulting in a foldable value (e.g., a list). Then yield each of the individual values in that foldable value separately. Generalizes concatMap, mapMaybe, and mapFoldable. Subject to fusion
Apply a transformation to all values in a stream, concatenating the output values. Subject to fusion Since 0.3.0
Map a function over all the elements of a container and concatenate the resulting lists.
Synonym for oconcatMap
Map a function over the byte stream and concatenate the results
Map a function over the items and concatenate the results. See also rigidConcatMap.
Map a stream producing function on each element of the stream and then flatten the results into a single stream.
>>> concatMap f = Stream.concatMapM (return . f)

>>> concatMap f = Stream.concatMapWith Stream.serial f

>>> concatMap f = Stream.concat . Stream.map f
O(n). Apply a function to each element, and take the union of the results
O(n). Apply a function to each element, and take the union of the results
Map a function over a Vector and concatenate the results
Version of concatMap constrained to Container.
>>> concatMap (\x -> [x + 1, x + 2]) [1, 2, 3]
[2,3,3,4,4,5]