...

/

When Specifications Are Used?

When Specifications Are Used?

Understand when and why we use specifications in Elixir.

We'll cover the following...

When we looked at @callback in the Behaviours lesson, we saw that we defined callbacks in terms of their parameter types and return values. For example, we might write the following:

@callback parse(uri_info :: URI.Info.t) :: URI.Info.t
@callback default_port() :: integer

The terms URI.Info.t and integer ...