We have been looking at Maybe and Either in earlier recipes and used them for conveying error. For example, Nothing :: Maybe a conveys that the evaluation has resulted in an error, and that is how we now have Nothing. Either is more informative than Maybe and conveys more information through its Left constructor.
In this recipe, we will work with three situations:
- Working with error and catching it later
- Working with IO exception and catching it
- Creating a custom exception, raising it, and catching it