Bottle.List (Bottle v1.0.1) View Source

Provides custom guards for lists

Link to this section Summary

Functions

Guard that passes for an empty list

Guard that passes for a list of a specific length

Guard that passes for a non empty list

Link to this section Functions

Link to this macro

is_empty_list(sub)

View Source (macro)

Guard that passes for an empty list

Examples

iex> is_empty_list([])
true

iex> is_empty_list([:foo])
false     
Link to this macro

is_list_with_length(sub, expected_length)

View Source (macro)

Guard that passes for a list of a specific length

Examples

iex> is_list_with_length([], 0)
true

iex> is_list_with_length([:foo], 1)
true

iex> is_list_with_length([:foo], 2)
false
Link to this macro

is_non_empty_list(sub)

View Source (macro)

Guard that passes for a non empty list

Examples

iex> is_non_empty_list([:foo])
true

iex> is_non_empty_list([])
false