View Source Vx.Not (Vx v0.1.0)

The Not type negates the given type or value.

Summary

Functions

Builds a new type negating the passed one.

Types

Functions

@spec t(of) :: t(of) when of: Vx.t()

Builds a new type negating the passed one.

Examples

iex> Vx.Not.t(Vx.Integer.t()) |> Vx.validate!("foo")
:ok

iex> Vx.Not.t(Vx.Integer.t()) |> Vx.validate!(123)
** (Vx.Error) must not be integer