View Source ExAequoFn.Stream (ExAequoFn v0.1.2)
Summary
Types
@type either_t(error_t, ok_t) :: {:ok, ok_t} | {:error, error_t}
@type function_t() :: (... -> any())
@type maybe(t) :: nil | t
@type result_t(t) :: {:ok, t} | :error
@type transformers_t() :: [transformer_t()]
Functions
@spec next(Enumerable.t()) :: {any(), Enumerable.t()}
Advances and returns head
iex(1)> enum = 1..3
...(1)> {1, s} = next(enum)
...(1)> s |> Enum.to_list
[2, 3]
At the end we get nil
iex(2)> {1, s} = next([1])
...(2)> next(s)
nil