why use elixir code example
Example 1: elixir if statement
iex> if true do
...> "This works!"
...> end
"This works!"
iex> unless true do
...> "This will never be seen"
...> end
nil
iex> if nil do
...> "This won't be seen"
...> else
...> "This will"
...> end
"This will"
Example 2: elixir function arity
inspect :erlang.fun_info(fn -> :ok end)[:arity]
inspect :erlang.fun_info(fn a,b-> a+b end)[:arity]
inspect fn a,b-> a+b end |> is_function
inspect fn a,b-> a+b end |> is_function(1)