A.Vector.flat_map

You're seeing just the function flat_map, go back to A.Vector module for more information.

Specs

flat_map(t(val), (val -> t(mapped_val))) :: t(mapped_val)
when val: value(), mapped_val: value()

Maps the given fun over vector and flattens the result.

This function returns a new vector built by concatenating the results of invoking fun on each element of vector together.

Runs in linear time.

Examples

iex> A.Vector.new(0..4) |> A.Vector.flat_map(fn i -> List.duplicate(i, i) end)
vec([1, 2, 2, 3, 3, 3, 4, 4, 4, 4])