tagged v0.1.0 Tagged.Status View Source
Resoning in terms of the status of a result.
iex> use Tagged.Status
iex> ok(:computer)
{:ok, :computer}
iex> with ok(it) <- Keyword.fetch([a: "bacon"], :a), do: "Chunky #{it}!"
"Chunky bacon!"
Link to this section Summary
Functions
Constructor for error
tagged value tuples. Can also be used
to destructure tuples.
Constructor for ok
tagged value tuples. Can also be used
to destructure tuples.
Link to this section Types
Link to this section Functions
Specs
Constructor for error
tagged value tuples. Can also be used
to destructure tuples.
iex> use Elixir.Tagged.Constructor
iex> with error(val) <- {:error, :match}, do: val
:match
iex> with error(_) <- {:not_error, :match}, do: true
{:not_error, :match}
Specs
Constructor for ok
tagged value tuples. Can also be used
to destructure tuples.
iex> use Elixir.Tagged.Constructor
iex> with ok(val) <- {:ok, :match}, do: val
:match
iex> with ok(_) <- {:not_ok, :match}, do: true
{:not_ok, :match}