Hi,
What would be the Erlang equivalent for the with special form like:
with {:ok, width} <- Map.fetch(opts, :width),
{:ok, height} <- Map.fetch(opts, :height) do
{:ok, width * height}
else
:error -> {:error, :wrong_data}
end
I’m switching back and forth between the languages and still didn’t found a nice abstraction in Erlang for this.
Thanks,
Qqwy
2
Elixir’s with compiles to a nested case-statement. Unfortunately Erlang does not provide such an abstraction itself.
Yes, nested case statements is the problem I’m trying to solve 
There is no equivalent, although there are libraries such as erlando that implement the do-notation.
Ooo I hadn’t ran across erlando in a long time, that’s a blast from the past. ^.^
maybe
{ok, A} ?= a(),
true = A >= 0,
{ok, B} ?= b(),
A + B
end