Search⌘ K
AI Features

Defining New Types

Explore how to define custom types in Elixir by using the @type, @typep, and @opaque attributes. Understand parameterized types and visibility rules, which help improve code structure and readability.

We'll cover the following...

The attribute @type can be used to define new types as follows:

@type type_name :: type_specification.

Examples

Elixir uses this to predefine some built-in types and aliases. Here are just some of them: ...