Skip to content
TE810 · Effects · warning

Handler covers an effect the body never performs

A warning, not a build failure. A `handle` block using an explicitly annotated `handler<…>` value covers an effect the handled body never actually performs.

Why this fires

This is a warning, not a hard error — it does not fail the build. A handle block, using a handler value typed with an explicit handler<...> annotation, covers an effect the handled body never actually performs.

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

let h: handler<Fs + Log, str> = handler {
    Fs::read(_p) => "stub",
    Log::info(_m) => "noop",
}

fn run() with Fs -> str {
    return perform Fs::read("x")
}

fn main() {
    let _ = handle run() with h
    // warning[TE810]: handler covers `Log` but the body never performs it
}

h is typed to cover both Fs and Log, but run() only ever performs Fs.

Fix it

Narrow the handler's declared coverage to only the effects the body actually performs:

let h: handler<Fs, str> = handler {
    Fs::read(_p) => "stub",
}

Or, if Log was meant to be performed somewhere, make sure the call is wired up correctly (a typo in a called function's name can silently make an effect look unused).

See also

  • TE803 — the opposite problem: a handler that does NOT cover an effect the body performs (a hard error).
  • /docs/algebraic-effects — handler values and the handler<...> type.

See also

Search Zolo

9 results

en