S0014: unknown pure function
Generated from rellum-diagnostics/src/db.rs.
Explanation
A pure call can only target a function that is visible in the current module: a local function, an imported public function, a generic function template, or a built-in prelude function. The compiler resolves pure calls before lowering so it can type-check arguments, instantiate generics, and keep effectful work out of pure space.
Common causes
- misspelling a function name or using the wrong naming convention
- calling a helper from another module without importing it
- using a prelude function name that does not exist
- calling an effect as if it were a pure function
Canonical fixes
- define the function before calling it
Before:
answer = double(21)
After:
double(x: Int) : Int = x * 2
answer = double(21)
- import the function from the module that exports it
Before:
answer = distance(origin, point)
After:
import geometry { distance }
answer = distance(origin, point)
- use effect calls only from effect bindings or requests
Before:
value = print!(message)
After:
main! = print!(message)
Code example
answer = double(21)