Bottle.List (Bottle v0.1.3) 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
Guard that passes for an empty list
Examples
iex> is_empty_list([])
true
iex> is_empty_list([:foo])
false
iex> is_empty_list(%{foo: "bar"})
false
iex> is_empty_list({"anything", "else"})
false
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: "bar"}, 1)
false
iex> is_list_with_length({"anything", "else"}, 2)
false
Guard that passes for a non empty list
Examples
iex> is_non_empty_list([:foo])
true
iex> is_non_empty_list([])
false
iex> is_non_empty_list(%{foo: "bar"})
false
iex> is_non_empty_list({"anything", "else"})
false