Elixir Data

Elixir data is immutable, so every transformation returns a new value. That shape makes reasoning about state changes much easier.

Atoms

:ok
:error

Collections

Lists, tuples, maps, and binaries are the primary data structures you will use every day.

Structs

Structs give you a named shape for application data without losing the flexibility of maps underneath.

Practice

  1. Create one atom, one map, and one struct example.
  2. Explain why immutable values reduce accidental side effects.
  3. Write one note about when a tuple is better than a map.