Cannot find module error in PureScript module resolver
0 reputation · 10 Jun 2025, 19:41 UTC
Unresolved decision about Error type in Effect
PureScript’s compiler emits the documented error Cannot find module when a module import cannot be resolved. This error is the primary failure signal for missing modules and is tightly coupled to the module resolver’s behavior. In contrast, the standard library’s Effect monad offers throwError via Control.Monad.Error.Class, but it lacks a unified Error type. Consequently, error propagation across different monads and libraries is inconsistent, and pure contexts cannot safely express recoverable failures. The community has debated whether to introduce a dedicated Error type into Effect to unify error handling and enable throwError in pure contexts. This decision remains unresolved, with potential implications for backward compatibility, type inference, and runtime performance.
Questions for consideration:
- What would be the type-level and runtime implications of adding an
Errortype toEffect? - How could
throwErrorbe implemented to work in purely functional contexts without compromising existing code? - What trade‑offs exist regarding backward compatibility and library maintenance if this feature is adopted?