Elixir Conditionals
10/03/2022 · 1 min read
WITH Assuming a chain of conditions:
``
m = %{a: 1, c: 3}
a = with {:ok, number} <- Map.fetch(m, :a), true <- is_even(number) do IO.puts “#{number} divided by 2 is #{div(number, 2)}” :even else :error -> IO.puts(“We don’t h
Read more...