Chapter 2 Working with Variables and Functions

Variables and functions are the fundamentals of any functional language, and Elixir is no different. It’s important to have a solid understanding of how they work so you can be comfortable working with the various types of functions. In this chapter, we’ll use Elixir to explore the basics and build a solid foundation for the upcoming advanced topics.

Our first topic will be values. In Elixir, valid values include strings, integers, floats, lists, maps, functions, and a few more. Yes, functions are values here, as you’ll see later in the chapter. But first, let’s take a look at how we can represent common values and their types.

Get Learn Functional Programming with Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.