ark v0.1.0 Ark.Wok

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

Wrapping ok.

Wraps the passed value in an :ok tuple if :

  • The value is not already wrapped
  • It is not an {:error, v} tuple
  • The value is not the single atom :ok

Questionning ok.

Returns true if the value is an {:ok, val} tuple or the single atom :ok. Returns false otherwise.

Unwrapping ok.

Unwraps an {:ok, val} tuple, giving only the value, returning anything else as-is. Does not unwrap :error tuples.

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.

ẁok is an alias of wrapping function :ok.