3 ms·
You can write custom guards out of any built in function that can already be used in a guard. Like defguard is_list_or_even_int(val) do is_list(val) or (is_
by el_oni 3y ago
You can write custom guards out of any built in function that can already be used in a guard.
Like defguard is_list_or_even_int(val) do
is_list(val) or (is_integer(val) and val % 2 ==0)
end