rop v0.5.1 Rop

Summary

Functions

Extracts the value from a tagged tuple like {:ok, value} Raises the value from a tagged tuple like {:error, value} Raise the arguments else

Functions

ok(x)

Extracts the value from a tagged tuple like {:ok, value} Raises the value from a tagged tuple like {:error, value} Raise the arguments else

For example:

iex> ok({:ok, 1})
1

iex> ok({:error, "some"})
** (RuntimeError) some

iex> ok({:anything, "some"})
** (ArgumentError) raise/1 expects an alias, string or exception as the first argument, got: {:anything, "some"}