Error on instance of Control.Exception.Exception

Hi, I read here: www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html that this is declared: --- class (Typeable e, Show e) => Exception e where toException :: e -> SomeException fromException :: SomeException -> Maybe e --- I understand this means Excepton is a class. But after I try: --- instance Exception DbError where --- GHC says: Type constructor `Exception' used as a class In the instance declaration for `Exception DbError' Isn't Exception a class? If it is, what is the proper way to have an Exception instance for my type? Thanks, Maurício

On Sun, Feb 22, 2009 at 9:41 PM, Maurício
www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html
These are the docs for the latest GHC version.
Type constructor `Exception' used as a class In the instance declaration for `Exception DbError'
What GHC version do you have? Old base packages (< 4, IIRC) don't have extensible exceptions and 'Exception' is just an ADT. HTH, -- Felipe.
participants (2)
-
Felipe Lessa
-
Maurício