A.Vector.map_intersperse
You're seeing just the function
map_intersperse
, go back to A.Vector module for more information.
Specs
map_intersperse(t(val), separator, (val -> mapped_val)) :: t(mapped_val | separator) when val: value(), separator: value(), mapped_val: value()
Maps and intersperses the vector
in one pass.
Runs in linear time.
Examples
iex> A.Vector.new(1..6) |> A.Vector.map_intersperse(nil, &(&1 * 10))
vec([10, nil, 20, nil, 30, nil, 40, nil, 50, nil, 60])