In this video training, you’ll learn how to use alias, require, import, use and nested modules in Elixir.

In order to facilitate software reuse, Elixir provides three directives (alias, require and import) plus a macro called use summarized below:

# Alias the module so it can be called as Bar instead of Foo.Bar
alias Foo.Bar, as: Bar

# Require the module in order to use its macros
require Foo

# Import functions from Foo so they can be called without the `Foo.` prefix
import Foo

# Invokes the custom code defined in Foo as an extension point
use Foo

#elixir

Alias, Require, Import, Use and Nested Modules - Elixir Episode 11
1.15 GEEK