[GHC] #2819: Bad example code in documentation of Control.Exception.catch

GHC trac at galois.com
Sat Nov 29 06:59:48 EST 2008


#2819: Bad example code in documentation of Control.Exception.catch
---------------------------------+------------------------------------------
    Reporter:  mafo              |        Owner:                  
        Type:  bug               |       Status:  new             
    Priority:  normal            |    Milestone:  6.10.2          
   Component:  libraries/base    |      Version:  6.10.1          
    Severity:  trivial           |   Resolution:                  
    Keywords:                    |   Difficulty:  Unknown         
    Testcase:                    |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
---------------------------------+------------------------------------------
Comment (by claus):

 The `catchJust` example there also refers to `errorCalls`, which is in the
 old exceptions module. Overall, that page could be more explicit about the
 recent switch to extensible exception, just as it is still explicit about
 the once new asynchronous exceptions. Perhaps a separate section, on that
 page, with a brief history of changes, and references? All the examples
 should be converted to the intended new style, whatever that is;-)

 Summary, for those looking up this ticket: instead of a single, non-
 extensible exception type, there are now many specialist exception types
 and one extensible exception class. If your exception handler isn't
 specific about which type of exceptions it wants to handle, a type error
 about ambiguity results. See the instances of the `Exception` class for
 specific types of exceptions,

 http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-
 Exception.html#1

 and annotate the `e` in that example with the type of exception you want
 (`IOException` here).

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2819#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list