Effective Haskell - Chapter 8 Error Handling

In the error handling section in Chapter 8:

  1. In the first refactor (ePub p 202), it says “we’ll start by adding a second helper function called handleIOError”, but this function is defined and not used (withErrorHandling, defined identically, is used in the code).
  2. Before defining eitherToErr (ePub p 203), tests are defined. There hasn’t been any discussion on writing tests, the library that’s used, adding a test stanza to the cabal file, and how to run tests.
  3. In the paragraph on constructing an IO exception (ePub p 203) it says “First we need to an IOError value”, which is missing a verb (construct?)
  4. The final version of runHCat (ePub p. 204) uses handleIOError. Should both versions use same function (handleIOError or withErrorHandling)?
1 Like