snowhite v2.1.3 Snowhite.Helpers.List View Source

Link to this section Summary

Functions

Same as cycle/2 excepts that is uses 1 as the count value

Cycles a list by a given number of items (default to 1).

Filters and maps a list with two different function

Link to this section Functions

Specs

cycle(list()) :: list()

Same as cycle/2 excepts that is uses 1 as the count value

Specs

cycle(list(), non_neg_integer()) :: list()

Cycles a list by a given number of items (default to 1).

Examples

iex> cycle([1, 2, 3, 4])
[2, 3, 4, 1]
iex> cycle([1, 2, 3, 4], 2)
[3, 4, 1, 2]
Link to this function

filter_map(items, filter_function, map_function)

View Source

Specs

filter_map(Enum.t(), (any() -> boolean()), (any() -> any())) :: [any()]

Filters and maps a list with two different function