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#
fn main() {
time.sleep(10)
}Fixed#
fn main() uses time {
time.sleep(10)
}Common causes#
- Calling
fs,net,time,rand,envorprocwithoutuses. - Calling one of your own functions that declares an effect: the caller needs it too.
printis always allowed and needs no effect.