A.Vector.filter
You're seeing just the function
filter
, go back to A.Vector module for more information.
Specs
filter(t(val), (val -> as_boolean(term()))) :: t(val) when val: value()
Filters the vector
, i.e. return a new vector containing only elements
for which fun
returns a truthy (neither false
nor nil
) value.
Runs in linear time.
Examples
iex> vector = A.Vector.new(1..100)
iex> A.Vector.filter(vector, fn i -> rem(i, 13) == 0 end)
vec([13, 26, 39, 52, 65, 78, 91])