# `Arc.Types`
[🔗](https://github.com/Cratis/Arc.Elixir/blob/main/lib/arc/types.ex#L4)

The field types Arc understands, and conversion between wire values and Elixir values.

A type is one of `:string`, `:integer`, `:float`, `:boolean`, `:uuid`, `:date`, `:datetime`,
`:map`, `{:list, type}`, a `Chronicle.Concept` module (a strongly typed wrapper over one
primitive), or a module that `use Arc.Schema` (a nested type).

# `t`

```elixir
@type t() :: atom() | {:list, t()}
```

# `cast`

```elixir
@spec cast(t(), term()) :: {:ok, term()} | :error
```

Converts a wire value to the Elixir value of `type`.

Strings are accepted for numbers and booleans so the same function converts query-string
arguments. Returns `{:ok, value}` or `:error`.

# `concept?`

```elixir
@spec concept?(term()) :: boolean()
```

Whether `module` is a `Chronicle.Concept`.

# `concept_primitive`

```elixir
@spec concept_primitive(module()) :: atom()
```

Resolves a concept to the primitive it wraps (`:string`, `:integer`, `:float`, `:boolean` or `:uuid`).

# `describe`

```elixir
@spec describe(t()) :: String.t()
```

A human-readable name for a type, used in validation messages.

# `primitive?`

```elixir
@spec primitive?(term()) :: boolean()
```

Whether `type` is one of the built-in primitive types.

# `schema?`

```elixir
@spec schema?(term()) :: boolean()
```

Whether `module` is an Arc schema (declares fields with `schema do ... end`).

---

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