Error codes

E0030: invalid |> step

In a terminal: auk explain E0030 prints this page.

On this page

x |> f(a) means f(x, a): each step after |> is a function name or path, with optional arguments. Mixing a .method() into the same chain, or piping into a closure, is rejected.

Wrong#

auk
fn total(xs: [int]): int = xs |> map(x => x * 2).sum()

Fixed#

auk
fn total(xs: [int]): int = xs |> map(x => x * 2) |> sum()

Common causes#

  • Mixing |> and . in one chain: use one style throughout, or wrap the pipe in parentheses.
  • Piping into a closure xs |> (x => ...): call a named function instead.
  • A literal or expression after |>.

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page