nwith v0.1.0 Nwith

Documentation for Nwith.

Link to this section Summary

Functions

Named with. Just like with.

Link to this section Functions

Link to this macro

nwith(clauses, list)

(macro)

Named with. Just like with.

Examples

iex> import Nwith, only: [nwith: 2]
iex> nwith firstly: {:ok, value} = result <- {:ok, true},
...>       secondly: true <- value,
...>       finally: {:ok, true} <- result do
...>   "The result is " <> inspect(result)
...> else
...>   secondly: false ->
...>     "Not gonna happen"
...>
...>   secondly: nil ->
...>     "Just nothing"
...>
...>   finally: error ->
...>     "Something went wrong: #{inspect(error)}"
...> end
"The result is {:ok, true}"