Error codes

E0410: effect used but not declared

In a terminal: auk explain E0410 prints this page.

On this page

A function that touches the outside world must say so with uses fs, net, time, rand, env, proc (or ffi). This is how Auk keeps effects visible: from a signature alone you know whether a function is pure. The note shows the call chain that needs the effect.

Wrong#

auk
fn main() {
  time.sleep(10)
}

Fixed#

auk
fn main() uses time {
  time.sleep(10)
}

Common causes#

  • Calling fs, net, time, rand, env or proc without uses.
  • Calling one of your own functions that declares an effect: the caller needs it too.
  • print is always allowed and needs no effect.

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