Stream.each

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

Specs

each(Enumerable.t(), (element() -> term())) :: Enumerable.t()

Executes the given function for each element.

Useful for adding side effects (like printing) to a stream.

Examples

iex> stream = Stream.each([1, 2, 3], fn x -> send(self(), x) end)
iex> Enum.to_list(stream)
iex> receive do: (x when is_integer(x) -> x)
1
iex> receive do: (x when is_integer(x) -> x)
2
iex> receive do: (x when is_integer(x) -> x)
3