Chapter 16

Handling Errors in Haskell

IN THIS CHAPTER

Check Understanding Haskell bugs

Check Locating and describing Haskell errors

Check Squashing Haskell bugs

Most application code contains errors. It’s a blanket statement that you may doubt, but the wealth of errors is obvious when you consider the number of security breaches and hacks that appear in the trade press, not to mention the odd results that sometimes occur from seemingly correct data analysis. If the code has no bugs, updates will occur less often. This chapter discusses errors from a pure functional language perspective; Chapter 17 looks at the same issue from an impure language perspective, which can differ because impure languages often rely on procedures.

After you identify an error, you can describe the error in detail and use that description to locate the error in the application code. At least, this process is the theory that most people go by when finding errors. Reality is different. Errors commonly hide in plain view because the developer isn’t squinting just the right way in order to see them. Bias, perspective, and lack of understanding all play a role in hiding errors from view. This chapter also describes how to locate ...

Get Functional Programming For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.