View Source ExAequoFn.Stream (ExAequoFn v0.1.1)

Summary

Functions

Advances and returns head

Types

Link to this type

either_t(error_t, ok_t)

View Source
@type either_t(error_t, ok_t) :: {:ok, ok_t} | {:error, error_t}
@type maybe(t) :: nil | t
@type result_t(t) :: {:ok, t} | :error
@type stream_t() :: %Stream{accs: term(), done: term(), enum: term(), funs: term()}
@type transformer_t() :: (any() -> result_t(any()))
@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