An explicit error represents failure as a value in program data instead of relying on implicit exception control flow. This makes failure available to business logic and allows native exceptions such as IOException to become framework-level error types. section 13.1.3
Explicit error
An explicit error is a failure represented as a value in a program's data rather than raised implicitly through exception control flow.
How Functional Design and Architecture: Examples in Haskell covers it
- How deep it goes
- Explains conversion through smart constructors and interpreters, while deferring a complete error taxonomy.
- Examples
- Uses filesystem read and write operations, IOException conversion, FSResult, and deliberately silenced writes.
- What it assumes
- Assumes familiarity with exceptions and functional abstractions while demonstrating the conversion from native failures to values.
- What you can do after
- Apply explicit errors by converting native filesystem exceptions into typed values before passing results to application logic.
- How it connects
- Connects explicit errors with native exceptions, interpreters, smart constructors, free monads, and result types.
This explainer was generated by Manning's knowledge graph from the text of Functional Design and Architecture: Examples in Haskell. The section links point to the parts of the book it draws on.
