Defining New Types
Understand how to define new types in Elixir.
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:
Get hands-on with 1300+ tech skills courses.