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 {} // okSee also¶
TE800— aperformwithout a matchingwithdeclaration.TE804— the same "unknown name" idea for an operation inside ahandlearm.- /docs/algebraic-effects — declaring and using effects.