Tyyppi.of_type-question-mark
You're seeing just the function
of_type-question-mark
, go back to Tyyppi module for more information.
Specs
of_type?(Tyyppi.T.t(wrapped), any()) :: boolean() when wrapped: term()
Returns true
if the term
passed as the second parameter is of type type
.
The first parameter is expected to be of type Tyyppi.T.t(term())
.
Examples:
iex> require Tyyppi
...> type = Tyyppi.parse(atom())
%Tyyppi.T{
definition: {:type, 0, :atom, []},
module: nil,
name: nil,
params: [],
quoted: {:atom, [], []},
source: nil,
type: :built_in
}
...> Tyyppi.of_type?(type, :ok)
true
...> Tyyppi.of_type?(type, 42)
false
...> type = Tyyppi.parse(GenServer.on_start())
...> Tyyppi.of_type?(type, {:error, {:already_started, self()}})
true
...> Tyyppi.of_type?(type, :foo)
false