Introduction to Datatypes

Let’s get to know about different kinds of datatypes along with their use in Elixir.

The importance of understanding datatypes

In this chapter, we’ll look at Elixir’s implementation of the foundational datatypes. You may be primed to get to the functions or the OTP, but let’s take a moment to talk about these building blocks.

In Elixir, the data is the good stuff. If you have worked with functional languages before, you know that they work differently under the hood than what we’d find in other languages. Those who love programming contests or analyzing algorithms know that our data structures drive the shape of our design. If we want to get the most out of this language, we will need to know the following Elixir data structures:

  • The best Elixir datatype to employ in each situation.

  • Which structures are the fastest to copy.

  • Which ones allow the smoothest updates.

We need to understand how functional programs will impact our choices and why specific structures most elegantly represent the problems we’re likely to encounter.

Get hands-on with 1200+ tech skills courses.