O'Reilly logo

Learning Elixir by Kenny Ballou

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Modules and Functions – Creating Functional Building Blocks

In the previous chapter, we introduced the basic, built-in types of Elixir.

In this chapter, we are going to dive further into functions and properly introduce modules. Furthermore, we are going to continue our discussion on pattern matching.

And, we will now get into some real, nonelementary examples that show how we can solve problems with what we have learned so far.

Modules

If you're familiar with other languages such as Python, modules aren't really a new concept. They define a set of functions and essentially namespace these functions from others. This avoids name conflicts and introduces a level of plugability and reusability throughout. Elixir modules, similarly, follow ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required