hd-lang

Tour · 9 of 25

A pipe reads in the order things happen, and _ shows where the value goes

Nested calls read inside out: in format_cents(with_tax(discounted(2500, 10), 8)) the first step is in the middle and the last is on the left. The pipe value |> step feeds a value into the next step, so the steps read top to bottom in the order they run. A step marks the value's slot with _, so you never guess which argument it fills; a bare function name, like format_cents, takes the value as its only argument. A call with no _ is an error rather than a guess.

Run: Ctrl+Enter · Pages: Alt+← Alt+→