Stream.filter

You're seeing just the function filter, go back to Stream module for more information.

Specs

filter(Enumerable.t(), (element() -> as_boolean(term()))) :: Enumerable.t()

Creates a stream that filters elements according to the given function on enumeration.

Examples

iex> stream = Stream.filter([1, 2, 3], fn x -> rem(x, 2) == 0 end)
iex> Enum.to_list(stream)
[2]