mayo v0.2.0 Mayo.List

Summary

Functions

Checks the number of elements in the list

Checks the maximum number of elements in the list

Checks the minimum number of elements in the list

Functions

length(value, len)

Checks the number of elements in the list.

iex> Mayo.List.length([1, 2, 3], 3)
[1, 2, 3]

iex> Mayo.List.length([1], 3)
{:error, %Mayo.Error{type: "list.length"}}
max(value, len)

Checks the maximum number of elements in the list.

iex> Mayo.List.max([1, 2, 3], 3)
[1, 2, 3]

iex> Mayo.List.max([1, 2, 3, 4], 3)
{:error, %Mayo.Error{type: "list.max"}}
min(value, len)

Checks the minimum number of elements in the list.

iex> Mayo.List.min([1, 2, 3], 3)
[1, 2, 3]

iex> Mayo.List.min([], 3)
{:error, %Mayo.Error{type: "list.min"}}