snowhite v1.1.2 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).

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]