Tyyppi.of-question-mark
You're seeing just the macro
of-question-mark
, go back to Tyyppi module for more information.
Returns true
if the term
passed as the second parameter is of type type
.
The first parameter is expected to be a type
as in specs, e. g. atom()
or
GenServer.on_start()
.
Examples:
iex> require Tyyppi
...> Tyyppi.of?(atom(), :ok)
true
...> Tyyppi.of?(atom(), 42)
false
...> Tyyppi.of?(GenServer.on_start(), {:error, {:already_started, self()}})
true
...> Tyyppi.of?(GenServer.on_start(), :foo)
false