Current section
Files
Jump to
Current section
Files
lib/util/typing.ex
defmodule Boring.Util.Typing do
@spec type_name(any) :: String.t()
def type_name(x) do
cond do
is_atom(x) -> "atom"
is_binary(x) -> "binary"
is_bitstring(x) -> "bitstring"
is_boolean(x) -> "boolean"
is_exception(x) -> "exception"
is_float(x) -> "float"
is_function(x) -> "function"
is_integer(x) -> "integer"
is_list(x) -> "list"
is_map(x) -> "map"
is_nil(x) -> "nil"
is_number(x) -> "number"
is_pid(x) -> "pid"
is_port(x) -> "port"
is_reference(x) -> "reference"
is_struct(x) -> "struct"
is_tuple(x) -> "tuple"
true -> inspect(x)
end
end
end