tagged v0.1.0 Tagged View Source
Generates definitions of various things related to tagged value tuples, like
{:ok, value} and {:error, reason}.
Examples
defmodule Tagged.Status
use Tagged
deftagged ok
deftagged error
endConstruct and Destructure
iex> use Tagged.Status
iex> ok(:computer)
{:ok, :computer}
iex> with error(reason) <- {:ok, :computer}, do: raise reason
{:ok, :computer}Type definitions
_iex> use Tagged.Status
_iex> t Tagged.Status.error
@type error() :: {:error, term()}
Tagged value tuple, containing term(). Link to this section Summary
Functions
Generates a macro that definies all things related to a tagged value tuple,
{atom(), term()}. By default the macro has the same name as the tag, and all
the things are generated.
Link to this section Functions
Generates a macro that definies all things related to a tagged value tuple,
{atom(), term()}. By default the macro has the same name as the tag, and all
the things are generated.
Keywords
as: nameOverride default macro name. See
Tagged.Constructortype: falseOverride type definition. See
Tagged.Typedef