Skip to content
ZOLO / TE801 Effects · error

unknown effect in `with` clause

An effect was performed but no enclosing `handle` block handles it.

Why this fires

A function's with clause names an effect that doesn't exist.

fn run() with Ghost {}
//            ^^^^^ error[TE801]: unknown effect 'Ghost' in 'with' clause of function 'run'

Usually a typo — when the name is a close match to a real effect, the message includes a suggestion:

effect Filesystem { fn read(path: str) -> str }

fn f() with Filesystm {}
//          ^^^^^^^^^ error[TE801]: unknown effect 'Filesystm' in 'with' clause of
//                     function 'f'

Fix it

Declare the effect first, or fix the spelling:

effect Ghost { fn appear() }

fn run() with Ghost {}          // ok

See also

  • TE800 — a perform without a matching with declaration.
  • TE804 — the same "unknown name" idea for an operation inside a handle arm.
  • /docs/algebraic-effects — declaring and using effects.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br