| ... | ... | @@ -6,7 +6,12 @@ See [ExtensionDescriptionHowto](extension-description-howto) for information on |
|
|
|
## Brief Explanation
|
|
|
|
|
|
|
|
|
|
|
|
Exceptions may be thrown by pure code and caught in the `IO` monad.
|
|
|
|
In Haskell 98, exceptions may be caught and thrown only in the `IO` monad.
|
|
|
|
The `error` function generates failures from pure code, but cannot be caught.
|
|
|
|
|
|
|
|
|
|
|
|
Imprecise exceptions may be thrown by pure code and caught in the `IO` monad.
|
|
|
|
IO exceptions and `error` are subsumed as special cases.
|
|
|
|
|
|
|
|
## References
|
|
|
|
|
| ... | ... | @@ -17,6 +22,7 @@ Exceptions may be thrown by pure code and caught in the `IO` monad. |
|
|
|
## Pros
|
|
|
|
|
|
|
|
- more robust programs
|
|
|
|
- implemented by GHC and Hugs for several years
|
|
|
|
|
|
|
|
## Cons
|
|
|
|
|
| ... | ... | |