# `PtcRunner.SubAgent.Namespace.TypeVocabulary`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/sub_agent/namespace/type_vocabulary.ex#L1)

Converts Elixir values to human-readable type labels.

# `type_of`

```elixir
@spec type_of(term()) :: String.t()
```

Returns a type label for any value.

## Examples

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of([])
    "list[0]"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of([1, 2, 3])
    "list[3]"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(%{})
    "map[0]"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(%{a: 1})
    "map[1]"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(MapSet.new([1, 2]))
    "set[2]"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(~U[2026-05-03 09:14:00Z])
    "datetime"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(~D[2026-05-03])
    "date"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of({:closure, [], nil, %{}, [], %{}})
    "#fn[...]"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of("hello")
    "string"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(42)
    "integer"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(3.14)
    "float"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(true)
    "boolean"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(false)
    "boolean"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(:foo)
    "keyword"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(nil)
    "nil"

    iex> PtcRunner.SubAgent.Namespace.TypeVocabulary.type_of(fn -> :ok end)
    "fn"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
