Skip to main content
Tour of Lux · chapter 3 of 8

Functions & pipes

Definitions, lambdas, and the pipe operator.

Functions declare parameter and return types with : and ->. The last expression of a block is its value — no return needed (though it exists).
Lambdas are written x -> x + 1. The pipe operator |> feeds a value into the next call, so transformations read left to right. Builtins like map, filter, and sum also work method-style.