Elixir Functions
Functions in Elixir are recursive by default and often written as small pure transformations with explicit data flow.
Definitions
def greet(name), do: "Hello, #{name}!"
Anonymous functions
Anonymous functions are useful for callbacks, short transformations, and passing behavior around.
Pipe operator
The pipe operator keeps transformation chains readable by threading a value through a sequence of calls.
Practice
- Write one recursive function.
- Use one anonymous function with Enum.
- Rewrite one nested expression with the pipe operator.