Pipes
value |> function passes the value as the function’s first positional argument. If the call already has arguments, the piped value goes before them.
values = [1, 2, 3, 4]
result = values |> filter(n => n > 2) |> map(n => n * 10)
out(result) This is equivalent to map(filter(values, n => n > 2), n => n * 10) and produces [30, 40].
Pipes work with functions and modules, but each stage must accept the previous stage’s result. A module may return a record rather than the list you need: select the appropriate field before passing it on.
response = { ports: [80, 443, 8080] }
count = response.ports |> len
out(count) Keep a pipe chain on one logical line, wrap the expression in parentheses, or split it into named bindings. A bare newline ends the statement.