`with` construct usage question - variables in `else`

You’re throwing away the parameter passed to the else block. It will receive the result of the expression that failed.

iex(2)> with %{key: true} <- Map.new() do
...(2)>   :success
...(2)> else
...(2)>   result -> IO.inspect(result, label: "fail")
...(2)> end
fail: %{}