ark v0.4.1 Ark.Ok
Link to this section Summary
Functions
Wrapping ok.
Questionning ok.
Unwrapping ok.
Unwrapping ok with raise.
ẁok
is an alias of wrapping function :ok
.
Link to this section Functions
Link to this function
ok(value)
Wrapping ok.
Wraps the passed value in an :ok
tuple if :
- The value is not already wrapped
- It is not an
{:error, ...}
tuple - The value is not the single atom
:ok
Link to this function
ok?(value)
Questionning ok.
Returns true if the value is an {:ok, val}
tuple or the single
atom :ok
.
Returns false otherwise.
Link to this function
uok(value)
Unwrapping ok.
Unwraps an {:ok, val}
tuple, giving only the value, returning anything else
as-is. Does not unwrap {:error, ...}
tuples.
Link to this function
uok!(value)
Unwrapping ok with raise.
Unwraps an {:ok, val}
tuple, giving only the value, or returns the single
:ok
atom as-is. Raises with any other value.
Link to this function
wok(value)
ẁok
is an alias of wrapping function :ok
.