0Pricing
Elixir & Phoenix: Scalable Backend Development · Lesson

Working with Enumerable Collections

Discover how to effectively manipulate lists, maps, and other enumerables using Elixir's `Enum` module.

What are Enumerable Collections?

In Elixir, an enumerable is a data structure that you can iterate over, element by element. Think of them as containers for multiple values.

Elixir's powerful Enum module provides many functions to work with these collections efficiently.

  • Lists: Ordered collections of any data type.
  • Maps: Key-value stores.
  • Ranges: Sequences of numbers.

Understanding enumerables is key to functional programming in Elixir.

Working with Elixir Lists

Lists are perhaps the most common enumerable. They are ordered and can hold mixed data types.

Let's see a simple list:

defmodule ListExample do
  def run do
    my_list = [1, "hello", :atom, 4.5]
    IO.puts "My list: #{inspect my_list}"
  end
end

ListExample.run()

All lessons in this course

  1. Functions, Modules, and Pipelining
  2. Working with Enumerable Collections
  3. Recursion and Higher-Order Functions
  4. Lazy Evaluation with the Stream Module
← Back to Elixir & Phoenix: Scalable Backend Development