View Source Vx.Atom (Vx v0.1.0)

The Atom type.

Summary

Types

t()

The atom type.

Functions

t()

Builds a new Atom type.

Types

@opaque t()

The atom type.

Functions

@spec t() :: t()

Builds a new Atom type.

Examples

iex> Vx.Atom.t() |> Vx.validate!(:foo)
:ok

iex> Vx.Atom.t() |> Vx.validate!("foo")
** (Vx.Error) must be an atom

As nil, booleans and module names are also atoms, all of these are totally valid as well:

iex> Vx.Atom.t() |> Vx.validate!(nil)
:ok

iex> Vx.Atom.t() |> Vx.validate!(true)
:ok

iex> Vx.Atom.t() |> Vx.validate!(Address)
:ok