ExList v0.1.2 ExList.Backends.List.Utils View Source
Runtime utils to operate with ExList implemented with :list backend
Link to this section Summary
Functions
Function is similar to &Enum.concat/1 but not generic
Function is similar to &Enum.concat/2 but not generic
Function is similar to &Enum.reduce/3 but not generic
Function is similar to &Enum.reduce_while/3 but not generic
Function is similar to &Enum.reverse/3 but not generic
Link to this section Types
Link to this section Functions
Function is similar to &Enum.concat/1 but not generic
Examples
iex> use ExList, backend: :list
Elixir.ExList.Backends.List.Utils
iex> ex_list0 = list(1, list(2, list(3, list())))
iex> ex_list1 = list(4, list(5, list()))
iex> list(ex_list0, list(ex_list1, list())) |> ExList.concat
list(1, list(2, list(3, list(4, list(5, list())))))
Function is similar to &Enum.concat/2 but not generic
Examples
iex> use ExList, backend: :list
Elixir.ExList.Backends.List.Utils
iex> ex_list0 = list(1, list(2, list(3, list())))
iex> ex_list1 = list(4, list(5, list()))
iex> ExList.concat(ex_list0, ex_list1)
list(1, list(2, list(3, list(4, list(5, list())))))
Function is similar to &Enum.reduce/3 but not generic
Examples
iex> use ExList, backend: :list
Elixir.ExList.Backends.List.Utils
iex> list(1, list(2, list(3, list()))) |> ExList.reduce(0, &(&1 + &2))
6
Function is similar to &Enum.reduce_while/3 but not generic
Examples
iex> use ExList, backend: :list
Elixir.ExList.Backends.List.Utils
iex> ex_list = list("hello", list("world", list("stop", list("please", list()))))
iex> qty = ExList.reduce_while(ex_list, 0, &((&1 == "stop") && halt(&2) || cont(&2 + 1)))
iex> "there are "<>to_string(qty)<>" words before stop..."
"there are 2 words before stop..."