Skip to content
ZOLO / TE806 Effects · error

duplicate handler arm

A `perform` call or handler operation does not match the effect's declared signature.

Why this fires

A handle ... with { ... } block has two arms for the same effect operation.

effect Fs { fn read(p: str) -> str }

fn run() with Fs {
    let _ = perform Fs::read("x")
}

fn driver() {
    handle run() with {
        Fs::read(_) => "first",
        Fs::read(_) => "second",
        //  ^^^^ error[TE806]: duplicate handler arm for 'Fs::read'
    }
}

Fix it

Keep exactly one arm per operation:

fn driver() {
    handle run() with {
        Fs::read(_) => "first",   // ok — the only arm for Fs::read
    }
}

See also

  • TE803 — a handle block doesn't cover every operation of an effect.
  • TE804 — a handler arm names an operation the effect doesn't have.
  • /docs/algebraic-effects — handle blocks and handler arms.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br