An asynchronous exception is delivered independently of the execution point of the thread or computation it interrupts. In Haskell, one thread can cause an exception to occur in another thread, making control flow difficult to understand. section 13.1.1
Treat asynchronous exceptions as an architectural boundary problem:
- Prohibit asynchronous exceptions in the framework and underlying libraries because they can interrupt logic unexpectedly and crash an otherwise innocent thread. section 13.1.3
- Catch exceptions at interpreters and prevent external exceptions from leaking into business logic. section 13.1.3
- Convert native exceptions into explicit error values such as Either, so application logic can handle them deliberately. section 13.1.3
File-system interpreter
A file-system operation can catch the native exception inside its interpreter, convert the result into an FSResult value, and pass that value onward. The business logic then receives a controlled success or error result instead of an asynchronous failure escaping from the external layer.
Figure 13.7 Total exceptions gatekeeping
Use the exception-gatekeeping diagram to trace how interpreters catch and convert failures before they reach business logic. section 13.1.3

