Enum.all?/2
defmodule Enum do
def all?(enumerable, fun \\ fn x -> x end)
end
Returns true
if all the elements in enumerable
evaluate to a truthy value when the function fun
is applied over them.
As soon as one element evaluates to a falsy value, the iteration stops and the whole function returns false
.
On empty enumerables this function returns true
.