The libraries in this subsection are as follows:
When working with custom monads and exceptions, it's advisable to use generalized functions from the exceptions library to conveniently throw, catch, and mask exceptions. The functions work pretty much the same as their originals from Control.Exception
, unless somehow restricted by the base monad.
There are a few nuisances in the way exceptions are handled in Haskell and GHC. In particular, differentiating between synchronous and asynchronous exceptions is fickle. Plus, with current exception mechanisms in base, it's easy to make unnecessary mistakes, such as throwing asynchronous exceptions unintentionally (with throw
) or throwing important exceptions away with failing...