Pipelines
- The pipe operator. The pipe operator hands a result to the next call: data |> parse() |> validate() |> save().
- Design for piping. Pipeable functions take the data first: the convention that makes the ecosystem compose.
- Readable flows. Pipelines read as stories: each line one transformation, the whole function a paragraph.
Higher-Order Functions
- Functions as values. Anonymous functions are values: written between fn and end: passed, stored and captured.
- Behaviour injection. Higher-order functions inject behaviour: retry(fun), sort_by(&(&1.age)): logic as arguments.
- Closures. Anonymous functions close over their environment: context carried into later calls.
Recursion and Transformation
- Recursion under the hood. Elixir iterates by recursion: Enum wraps it, and writing it by hand stays a core skill.
- Tail calls. Tail-recursive functions with accumulators run in constant stack: the long-loop shape.
- reduce as the root. reduce is the primitive under map and filter: folding a collection into any answer.
Before and after this level
- Before: Level 2: Collections: Lists, Tuples and Maps, Enum, Streams.
- Next: Level 4: Data Modelling: Structs, Protocols, Behaviours.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Elixir Level 3: Functional Design cover?
Pipelines, Higher-Order Functions, Recursion and Transformation: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 2: Collections, which covers Lists, Tuples and Maps, Enum, Streams.