A readable companion to the official Elixir documentation, written with Claude.
AI assistants write fluent Elixir. What they get wrong is quieter: code that compiles, reads well and passes the obvious test, then fails under load, on unexpected input, or in a release. This book teaches the concepts and mechanisms you need to spot it. Each chapter has the same shape:
- Why it exists: the concept
- The building blocks: the API, condensed
- How it actually works: what the compiler and runtime do
- Plausible but wrong: code that looks right and isn't, and the fix
- Review checklist and sources
Facts are checked against the Elixir 1.20 documentation, and examples were run on Elixir 1.14 and 1.18. Runtime topics shared with Erlang (processes, memory, ETS, distribution, schedulers) are covered in the companion book, Learning Erlang from Claude.
Start with the Introduction; when reviewing code, use the Review Cheat Sheet.
Whole book in one PDF: Elixir book, all chapters, with a table of contents.
| # | Chapter | Markdown | |
|---|---|---|---|
| 0 | Introduction | md | |
| 1 | Pattern Matching and Data | md | |
| 2 | Errors and Control Flow | md | |
| 3 | Processes, Tasks and Agents | md | |
| 4 | GenServer | md | |
| 5 | Supervision and Registry | md | |
| 6 | Enum, Stream and Collections | md | |
| 7 | Strings and Unicode | md | |
| 8 | Protocols and Behaviours | md | |
| 9 | Macros | md | |
| 10 | Mix, Configuration and Releases | md | |
| 11 | Testing with ExUnit | md | |
| 12 | Types | md | |
| 13 | Observability | md | |
| 14 | Review Cheat Sheet | md |
Edit the Markdown in md/, then run tools/build.sh (all chapters) or tools/build.sh md/01-Pattern-Matching-and-Data.md (one chapter). It needs pandoc and Chromium or Chrome; set CHROME=/path/to/chrome if it isn't found automatically.
To rebuild the combined book, run tools/build_book.py (same requirements).