OkThen.Result.is_tagged
You're seeing just the macro
is_tagged
, go back to OkThen.Result module for more information.
Returns true if result
is tagged with the specified tag
atom.
Examples
iex> Result.is_tagged(:ok, :ok)
true
iex> Result.is_tagged({:ok, "hello"}, :ok)
true
iex> Result.is_tagged({:error, "hello"}, :ok)
false
iex> Result.is_tagged({:ok, 1, 2}, :ok)
true
iex> Result.is_tagged({:ok, {1, 2}}, :ok)
true
iex> Result.is_tagged({:strange, "hello"}, :strange)
true
iex> hello = fn -> "hello" end
...> hello.() |> Result.is_tagged(:ok)
false